summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-10-05 16:17:49 +0200
committerRobin Gareus <robin@gareus.org>2015-10-05 16:17:49 +0200
commit22b07e0233a29d9633ffa825a79503befaf2e16e (patch)
tree1d8b06056f8e12197158f5d906319767d3dedda5 /libs
parente11ba7b79d68bc1070b170236c22123966d7bcc3 (diff)
NOOP, remove trailing tabs/whitespace.
Diffstat (limited to 'libs')
-rw-r--r--libs/appleutility/AUOutputBL.cpp18
-rw-r--r--libs/appleutility/AUOutputBL.h18
-rw-r--r--libs/appleutility/AUParamInfo.cpp18
-rw-r--r--libs/appleutility/AUParamInfo.h24
-rw-r--r--libs/appleutility/CAAUParameter.cpp28
-rw-r--r--libs/appleutility/CAAUParameter.h36
-rw-r--r--libs/appleutility/CAAudioChannelLayout.cpp6
-rw-r--r--libs/appleutility/CAAudioChannelLayout.h30
-rw-r--r--libs/appleutility/CAAudioChannelLayoutObject.cpp18
-rw-r--r--libs/appleutility/CAAudioFile.cpp102
-rw-r--r--libs/appleutility/CAAudioFile.h68
-rw-r--r--libs/appleutility/CAAudioUnit.cpp132
-rw-r--r--libs/appleutility/CAAudioUnit.h82
-rw-r--r--libs/appleutility/CABufferList.cpp10
-rw-r--r--libs/appleutility/CABufferList.h48
-rw-r--r--libs/appleutility/CACFDictionary.cpp112
-rw-r--r--libs/appleutility/CACFDictionary.h22
-rw-r--r--libs/appleutility/CACFNumber.cpp4
-rw-r--r--libs/appleutility/CACFNumber.h2
-rw-r--r--libs/appleutility/CACFString.cpp4
-rw-r--r--libs/appleutility/CACFString.h6
-rw-r--r--libs/appleutility/CAComponent.cpp24
-rw-r--r--libs/appleutility/CAComponent.h32
-rw-r--r--libs/appleutility/CAComponentDescription.cpp12
-rw-r--r--libs/appleutility/CAComponentDescription.h34
-rw-r--r--libs/appleutility/CADebugMacros.h10
-rw-r--r--libs/appleutility/CAMath.h2
-rw-r--r--libs/appleutility/CAReferenceCounted.h6
-rw-r--r--libs/appleutility/CAStreamBasicDescription.cpp70
-rw-r--r--libs/appleutility/CAStreamBasicDescription.h36
-rw-r--r--libs/appleutility/CAXException.cpp2
-rw-r--r--libs/appleutility/CAXException.h18
-rw-r--r--libs/ardour/ardour/ardour.h2
-rw-r--r--libs/ardour/ardour/async_midi_port.h4
-rw-r--r--libs/ardour/ardour/audio_buffer.h2
-rw-r--r--libs/ardour/ardour/audio_track.h2
-rw-r--r--libs/ardour/ardour/audio_unit.h2
-rw-r--r--libs/ardour/ardour/audioengine.h8
-rw-r--r--libs/ardour/ardour/audioregion.h4
-rw-r--r--libs/ardour/ardour/automation_list.h4
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h4
-rw-r--r--libs/ardour/ardour/delivery.h2
-rw-r--r--libs/ardour/ardour/engine_state_controller.h2
-rw-r--r--libs/ardour/ardour/export_format_specification.h12
-rw-r--r--libs/ardour/ardour/file_source.h4
-rw-r--r--libs/ardour/ardour/graph.h2
-rw-r--r--libs/ardour/ardour/graphnode.h2
-rw-r--r--libs/ardour/ardour/midi_diskstream.h2
-rw-r--r--libs/ardour/ardour/midi_port.h4
-rw-r--r--libs/ardour/ardour/midi_scene_change.h2
-rw-r--r--libs/ardour/ardour/midi_track.h2
-rw-r--r--libs/ardour/ardour/midiport_manager.h2
-rw-r--r--libs/ardour/ardour/panner.h2
-rw-r--r--libs/ardour/ardour/playlist.h2
-rw-r--r--libs/ardour/ardour/plugin.h4
-rw-r--r--libs/ardour/ardour/plugin_insert.h2
-rw-r--r--libs/ardour/ardour/plugin_manager.h2
-rw-r--r--libs/ardour/ardour/port_manager.h10
-rw-r--r--libs/ardour/ardour/region.h10
-rw-r--r--libs/ardour/ardour/region_factory.h2
-rw-r--r--libs/ardour/ardour/revision.h2
-rw-r--r--libs/ardour/ardour/route.h8
-rw-r--r--libs/ardour/ardour/route_graph.h8
-rw-r--r--libs/ardour/ardour/scene_change.h2
-rw-r--r--libs/ardour/ardour/scene_changer.h4
-rw-r--r--libs/ardour/ardour/send.h2
-rw-r--r--libs/ardour/ardour/session.h36
-rw-r--r--libs/ardour/ardour/session_event.h2
-rw-r--r--libs/ardour/ardour/session_route.h6
-rw-r--r--libs/ardour/ardour/slave.h8
-rw-r--r--libs/ardour/ardour/smf_source.h2
-rw-r--r--libs/ardour/ardour/tempo.h20
-rw-r--r--libs/ardour/ardour/track.h6
-rw-r--r--libs/ardour/ardour/utils.h6
-rw-r--r--libs/ardour/ardour/vst_plugin.h8
-rw-r--r--libs/ardour/ardour/vst_types.h18
-rw-r--r--libs/ardour/ardour/windows_vst_plugin.h2
-rw-r--r--libs/ardour/async_midi_port.cc24
-rw-r--r--libs/ardour/audio_diskstream.cc58
-rw-r--r--libs/ardour/audio_playlist.cc12
-rw-r--r--libs/ardour/audio_playlist_importer.cc2
-rw-r--r--libs/ardour/audio_track.cc8
-rw-r--r--libs/ardour/audio_track_importer.cc6
-rw-r--r--libs/ardour/audio_unit.cc22
-rw-r--r--libs/ardour/audioengine.cc70
-rw-r--r--libs/ardour/audiofilesource.cc2
-rw-r--r--libs/ardour/audioregion.cc76
-rw-r--r--libs/ardour/audiosource.cc14
-rw-r--r--libs/ardour/auditioner.cc10
-rw-r--r--libs/ardour/automatable.cc4
-rw-r--r--libs/ardour/automation_list.cc4
-rw-r--r--libs/ardour/automation_watch.cc10
-rw-r--r--libs/ardour/buffer_set.cc2
-rw-r--r--libs/ardour/bundle.cc6
-rw-r--r--libs/ardour/butler.cc16
-rw-r--r--libs/ardour/control_protocol_manager.cc22
-rw-r--r--libs/ardour/cycle_timer.cc6
-rw-r--r--libs/ardour/delivery.cc4
-rw-r--r--libs/ardour/diskstream.cc8
-rw-r--r--libs/ardour/engine_slave.cc2
-rw-r--r--libs/ardour/engine_state_controller.cc8
-rw-r--r--libs/ardour/enums.cc2
-rw-r--r--libs/ardour/event_type_map.cc2
-rw-r--r--libs/ardour/export_filename.cc2
-rw-r--r--libs/ardour/export_graph_builder.cc2
-rw-r--r--libs/ardour/export_handler.cc16
-rw-r--r--libs/ardour/export_profile_manager.cc8
-rw-r--r--libs/ardour/file_source.cc12
-rw-r--r--libs/ardour/filesystem_paths.cc10
-rw-r--r--libs/ardour/filter.cc6
-rw-r--r--libs/ardour/globals.cc38
-rw-r--r--libs/ardour/graph.cc2
-rw-r--r--libs/ardour/import.cc6
-rw-r--r--libs/ardour/instrument_info.cc18
-rw-r--r--libs/ardour/internal_return.cc2
-rw-r--r--libs/ardour/internal_send.cc6
-rw-r--r--libs/ardour/io.cc22
-rw-r--r--libs/ardour/io_processor.cc16
-rw-r--r--libs/ardour/ladspa_plugin.cc8
-rw-r--r--libs/ardour/linux_vst_support.cc104
-rw-r--r--libs/ardour/location.cc12
-rw-r--r--libs/ardour/lv2_plugin.cc2
-rw-r--r--libs/ardour/midi_buffer.cc42
-rw-r--r--libs/ardour/midi_diskstream.cc38
-rw-r--r--libs/ardour/midi_model.cc10
-rw-r--r--libs/ardour/midi_patch_manager.cc4
-rw-r--r--libs/ardour/midi_port.cc28
-rw-r--r--libs/ardour/midi_ring_buffer.cc2
-rw-r--r--libs/ardour/midi_scene_change.cc2
-rw-r--r--libs/ardour/midi_scene_changer.cc26
-rw-r--r--libs/ardour/midi_state_tracker.cc2
-rw-r--r--libs/ardour/midi_track.cc24
-rw-r--r--libs/ardour/midi_ui.cc10
-rw-r--r--libs/ardour/midiport_manager.cc6
-rw-r--r--libs/ardour/monitor_processor.cc2
-rw-r--r--libs/ardour/pannable.cc2
-rw-r--r--libs/ardour/panner_shell.cc4
-rw-r--r--libs/ardour/playlist.cc82
-rw-r--r--libs/ardour/playlist_factory.cc18
-rw-r--r--libs/ardour/plugin.cc2
-rw-r--r--libs/ardour/plugin_insert.cc10
-rw-r--r--libs/ardour/port.cc12
-rw-r--r--libs/ardour/port_insert.cc2
-rw-r--r--libs/ardour/port_manager.cc24
-rw-r--r--libs/ardour/port_set.cc4
-rw-r--r--libs/ardour/processor.cc10
-rw-r--r--libs/ardour/quantize.cc10
-rw-r--r--libs/ardour/region.cc4
-rw-r--r--libs/ardour/region_factory.cc14
-rw-r--r--libs/ardour/route.cc76
-rw-r--r--libs/ardour/route_graph.cc12
-rw-r--r--libs/ardour/route_group.cc4
-rw-r--r--libs/ardour/search_paths.cc2
-rw-r--r--libs/ardour/send.cc8
-rw-r--r--libs/ardour/session.cc284
-rw-r--r--libs/ardour/session_click.cc4
-rw-r--r--libs/ardour/session_events.cc2
-rw-r--r--libs/ardour/session_export.cc8
-rw-r--r--libs/ardour/session_metadata.cc2
-rw-r--r--libs/ardour/session_midi.cc6
-rw-r--r--libs/ardour/session_playlists.cc2
-rw-r--r--libs/ardour/session_process.cc8
-rw-r--r--libs/ardour/session_rtevents.cc6
-rw-r--r--libs/ardour/session_transport.cc82
-rw-r--r--libs/ardour/smf_source.cc10
-rw-r--r--libs/ardour/sndfilesource.cc10
-rw-r--r--libs/ardour/soundcloud_upload.cc2
-rw-r--r--libs/ardour/source.cc2
-rw-r--r--libs/ardour/source_factory.cc4
-rw-r--r--libs/ardour/sse_functions_avx.cc2
-rw-r--r--libs/ardour/template_utils.cc4
-rw-r--r--libs/ardour/tempo.cc188
-rw-r--r--libs/ardour/test/audio_region_read_test.cc6
-rw-r--r--libs/ardour/test/audio_region_test.cc6
-rw-r--r--libs/ardour/test/automation_list_property_test.cc2
-rw-r--r--libs/ardour/test/bbt_test.cc2
-rw-r--r--libs/ardour/test/combine_regions_test.cc14
-rw-r--r--libs/ardour/test/control_surfaces_test.cc2
-rw-r--r--libs/ardour/test/framepos_minus_beats_test.cc14
-rw-r--r--libs/ardour/test/framepos_plus_beats_test.cc14
-rw-r--r--libs/ardour/test/framewalk_to_beats_test.cc14
-rw-r--r--libs/ardour/test/jack_utils_test.cc2
-rw-r--r--libs/ardour/test/load_session.cc2
-rw-r--r--libs/ardour/test/midi_clock_slave_test.h2
-rw-r--r--libs/ardour/test/mtdm_test.cc2
-rw-r--r--libs/ardour/test/playlist_equivalent_regions_test.cc2
-rw-r--r--libs/ardour/test/playlist_read_test.cc16
-rw-r--r--libs/ardour/test/playlist_read_test.h4
-rw-r--r--libs/ardour/test/profiling/load_session.cc2
-rw-r--r--libs/ardour/test/tempo_test.cc6
-rw-r--r--libs/ardour/test/test_util.cc2
-rw-r--r--libs/ardour/test/testrunner.cc10
-rw-r--r--libs/ardour/ticker.cc16
-rw-r--r--libs/ardour/track.cc44
-rw-r--r--libs/ardour/utils.cc2
-rw-r--r--libs/ardour/windows_vst_plugin.cc2
-rw-r--r--libs/audiographer/audiographer/broadcast_info.h2
-rw-r--r--libs/audiographer/audiographer/debug_utils.h2
-rw-r--r--libs/audiographer/audiographer/flag_debuggable.h4
-rw-r--r--libs/audiographer/audiographer/flag_field.h26
-rw-r--r--libs/audiographer/audiographer/general/chunker.h18
-rw-r--r--libs/audiographer/audiographer/general/deinterleaver.h34
-rw-r--r--libs/audiographer/audiographer/general/interleaver.h36
-rw-r--r--libs/audiographer/audiographer/general/normalizer.h4
-rw-r--r--libs/audiographer/audiographer/general/peak_reader.h8
-rw-r--r--libs/audiographer/audiographer/general/sample_format_converter.h8
-rw-r--r--libs/audiographer/audiographer/general/silence_trimmer.h74
-rw-r--r--libs/audiographer/audiographer/general/sr_converter.h6
-rw-r--r--libs/audiographer/audiographer/general/threader.h30
-rw-r--r--libs/audiographer/audiographer/process_context.h48
-rw-r--r--libs/audiographer/audiographer/routines.h8
-rw-r--r--libs/audiographer/audiographer/sink.h4
-rw-r--r--libs/audiographer/audiographer/sndfile/sndfile.h6
-rw-r--r--libs/audiographer/audiographer/sndfile/sndfile_base.h2
-rw-r--r--libs/audiographer/audiographer/sndfile/sndfile_reader.h10
-rw-r--r--libs/audiographer/audiographer/sndfile/sndfile_writer.h14
-rw-r--r--libs/audiographer/audiographer/source.h8
-rw-r--r--libs/audiographer/audiographer/type_utils.h8
-rw-r--r--libs/audiographer/audiographer/types.h4
-rw-r--r--libs/audiographer/audiographer/utils/listed_source.h6
-rw-r--r--libs/audiographer/src/debug_utils.cc4
-rw-r--r--libs/audiographer/src/general/normalizer.cc6
-rw-r--r--libs/audiographer/src/general/sample_format_converter.cc12
-rw-r--r--libs/audiographer/src/general/sr_converter.cc24
-rw-r--r--libs/audiographer/tests/general/chunker_test.cc50
-rw-r--r--libs/audiographer/tests/general/deinterleaver_test.cc28
-rw-r--r--libs/audiographer/tests/general/interleaver_deinterleaver_test.cc34
-rw-r--r--libs/audiographer/tests/general/interleaver_test.cc10
-rw-r--r--libs/audiographer/tests/general/normalizer_test.cc10
-rw-r--r--libs/audiographer/tests/general/peak_reader_test.cc6
-rw-r--r--libs/audiographer/tests/general/sample_format_converter_test.cc48
-rw-r--r--libs/audiographer/tests/general/silence_trimmer_test.cc48
-rw-r--r--libs/audiographer/tests/general/sr_converter_test.cc28
-rw-r--r--libs/audiographer/tests/general/threader_test.cc42
-rw-r--r--libs/audiographer/tests/sndfile/tmp_file_test.cc4
-rw-r--r--libs/audiographer/tests/type_utils_test.cc28
-rw-r--r--libs/audiographer/tests/utils.h6
-rw-r--r--libs/audiographer/tests/utils/identity_vertex_test.cc28
-rw-r--r--libs/backends/asio/asio_backend.cc2
-rw-r--r--libs/backends/coreaudio/coreaudio_backend.cc2
-rw-r--r--libs/backends/jack/jack_audiobackend.cc36
-rw-r--r--libs/backends/jack/jack_audiobackend.h2
-rw-r--r--libs/backends/jack/jack_connection.cc2
-rw-r--r--libs/backends/jack/jack_portengine.cc12
-rw-r--r--libs/backends/jack/jack_session.cc14
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c2
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.cc4
-rw-r--r--libs/backends/wavesaudio/waves_midi_device.cc10
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h4
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h8
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WUMathConsts.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h4
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h6
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.cpp4
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h12
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h34
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h42
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/safe_delete.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h4
-rw-r--r--libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/akupara/basics.hpp2
-rw-r--r--libs/backends/wavesaudio/wavesapi/akupara/compiletime_functions.hpp2
-rw-r--r--libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops.hpp2
-rw-r--r--libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops_gcc_x86.hpp8
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.cpp20
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h18
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h16
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp14
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp104
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h10
-rw-r--r--libs/canvas/arc.cc20
-rw-r--r--libs/canvas/arrow.cc18
-rw-r--r--libs/canvas/benchmark/benchmark.h2
-rw-r--r--libs/canvas/benchmark/items_at_point.cc6
-rw-r--r--libs/canvas/benchmark/render_from_log.cc6
-rw-r--r--libs/canvas/benchmark/render_parts.cc6
-rw-r--r--libs/canvas/benchmark/render_whole.cc4
-rw-r--r--libs/canvas/canvas.cc56
-rw-r--r--libs/canvas/canvas/arc.h2
-rw-r--r--libs/canvas/canvas/arrow.h4
-rw-r--r--libs/canvas/canvas/canvas.h8
-rw-r--r--libs/canvas/canvas/circle.h2
-rw-r--r--libs/canvas/canvas/colors.h10
-rw-r--r--libs/canvas/canvas/fill.h2
-rw-r--r--libs/canvas/canvas/flag.h4
-rw-r--r--libs/canvas/canvas/item.h18
-rw-r--r--libs/canvas/canvas/line.h2
-rw-r--r--libs/canvas/canvas/line_set.h2
-rw-r--r--libs/canvas/canvas/lookup_table.h2
-rw-r--r--libs/canvas/canvas/outline.h2
-rw-r--r--libs/canvas/canvas/poly_item.h2
-rw-r--r--libs/canvas/canvas/poly_line.h6
-rw-r--r--libs/canvas/canvas/polygon.h2
-rw-r--r--libs/canvas/canvas/rectangle.h2
-rw-r--r--libs/canvas/canvas/root_group.h2
-rw-r--r--libs/canvas/canvas/ruler.h10
-rw-r--r--libs/canvas/canvas/scroll_group.h2
-rw-r--r--libs/canvas/canvas/tracking_text.h2
-rw-r--r--libs/canvas/canvas/types.h20
-rw-r--r--libs/canvas/canvas/wave_view.h48
-rw-r--r--libs/canvas/canvas/widget.h2
-rw-r--r--libs/canvas/colors.cc22
-rw-r--r--libs/canvas/colorspace.cc70
-rw-r--r--libs/canvas/curve.cc4
-rw-r--r--libs/canvas/debug.cc2
-rw-r--r--libs/canvas/fill.cc6
-rw-r--r--libs/canvas/flag.cc2
-rw-r--r--libs/canvas/image.cc4
-rw-r--r--libs/canvas/item.cc60
-rw-r--r--libs/canvas/line.cc30
-rw-r--r--libs/canvas/line_set.cc10
-rw-r--r--libs/canvas/lookup_table.cc12
-rw-r--r--libs/canvas/pixbuf.cc4
-rw-r--r--libs/canvas/poly_item.cc16
-rw-r--r--libs/canvas/poly_line.cc16
-rw-r--r--libs/canvas/polygon.cc6
-rw-r--r--libs/canvas/rectangle.cc38
-rw-r--r--libs/canvas/root_group.cc2
-rw-r--r--libs/canvas/ruler.cc6
-rw-r--r--libs/canvas/scroll_group.cc6
-rw-r--r--libs/canvas/stateful_image.cc14
-rw-r--r--libs/canvas/test/arrow.cc2
-rw-r--r--libs/canvas/test/group.cc10
-rw-r--r--libs/canvas/test/gtk_drag.cc6
-rw-r--r--libs/canvas/test/gtk_many.cc6
-rw-r--r--libs/canvas/test/gtk_movement.cc6
-rw-r--r--libs/canvas/test/gtk_scene.cc4
-rw-r--r--libs/canvas/test/gtk_viewport.cc8
-rw-r--r--libs/canvas/test/optimizing_lookup_table.cc8
-rw-r--r--libs/canvas/test/render.cc2
-rw-r--r--libs/canvas/test/types.cc2
-rw-r--r--libs/canvas/test/types.h2
-rw-r--r--libs/canvas/test/wave_view.cc20
-rw-r--r--libs/canvas/test/xml.cc2
-rw-r--r--libs/canvas/test/xml.h2
-rw-r--r--libs/canvas/text.cc16
-rw-r--r--libs/canvas/tracking_text.cc4
-rw-r--r--libs/canvas/utils.cc2
-rw-r--r--libs/canvas/wave_view.cc154
-rw-r--r--libs/canvas/xfade_curve.cc2
-rw-r--r--libs/clearlooks-newer/animation.c70
-rw-r--r--libs/clearlooks-newer/cairo-support.c74
-rw-r--r--libs/clearlooks-newer/clearlooks_draw.c342
-rw-r--r--libs/clearlooks-newer/clearlooks_draw_glossy.c176
-rw-r--r--libs/clearlooks-newer/clearlooks_draw_gummy.c16
-rw-r--r--libs/clearlooks-newer/clearlooks_draw_inverted.c148
-rw-r--r--libs/clearlooks-newer/clearlooks_rc_style.c4
-rw-r--r--libs/clearlooks-newer/clearlooks_style.c268
-rw-r--r--libs/clearlooks-newer/clearlooks_style.h2
-rw-r--r--libs/clearlooks-newer/clearlooks_types.h12
-rw-r--r--libs/clearlooks-newer/support.c46
-rw-r--r--libs/clearlooks-newer/widget-information.c6
-rw-r--r--libs/clearlooks-older/clearlooks_draw.c304
-rw-r--r--libs/clearlooks-older/clearlooks_draw.h28
-rw-r--r--libs/clearlooks-older/clearlooks_rc_style.c20
-rw-r--r--libs/clearlooks-older/clearlooks_style.c540
-rw-r--r--libs/clearlooks-older/clearlooks_style.h20
-rw-r--r--libs/clearlooks-older/support.c156
-rw-r--r--libs/clearlooks-older/support.h6
-rw-r--r--libs/evoral/evoral/ControlList.hpp4
-rw-r--r--libs/evoral/evoral/ControlSet.hpp2
-rw-r--r--libs/evoral/evoral/Range.hpp10
-rw-r--r--libs/evoral/evoral/TimeConverter.hpp4
-rw-r--r--libs/evoral/evoral/midi_util.h2
-rw-r--r--libs/evoral/src/Control.cpp4
-rw-r--r--libs/evoral/src/ControlList.cpp64
-rw-r--r--libs/evoral/src/Curve.cpp2
-rw-r--r--libs/evoral/src/Event.cpp2
-rw-r--r--libs/evoral/src/Note.cpp2
-rw-r--r--libs/evoral/src/Sequence.cpp24
-rw-r--r--libs/evoral/src/libsmf/smf.c2
-rw-r--r--libs/evoral/src/libsmf/smf_decode.c6
-rw-r--r--libs/evoral/src/libsmf/smf_load.c18
-rw-r--r--libs/evoral/src/libsmf/smf_save.c2
-rw-r--r--libs/evoral/src/libsmf/smf_tempo.c6
-rw-r--r--libs/evoral/src/libsmf/smfsh.c6
-rw-r--r--libs/evoral/test/CurveTest.cpp2
-rw-r--r--libs/evoral/test/RangeTest.hpp2
-rw-r--r--libs/gtkmm2ext/actions.cc12
-rw-r--r--libs/gtkmm2ext/binding_proxy.cc6
-rw-r--r--libs/gtkmm2ext/cairo_packer.cc4
-rw-r--r--libs/gtkmm2ext/cairo_widget.cc12
-rw-r--r--libs/gtkmm2ext/cairocell.cc20
-rw-r--r--libs/gtkmm2ext/cell_renderer_color_selector.cc12
-rw-r--r--libs/gtkmm2ext/cell_renderer_pixbuf_multi.cc2
-rw-r--r--libs/gtkmm2ext/cell_renderer_pixbuf_toggle.cc2
-rw-r--r--libs/gtkmm2ext/choice.cc4
-rw-r--r--libs/gtkmm2ext/click_box.cc10
-rw-r--r--libs/gtkmm2ext/dndtreeview.cc4
-rw-r--r--libs/gtkmm2ext/fader.cc28
-rw-r--r--libs/gtkmm2ext/grouped_buttons.cc4
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc10
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/actions.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/auto_spin.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/barcontroller.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/bindable_button.h6
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/binding_proxy.h6
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/cairo_widget.h10
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/cairocell.h6
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_multi.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_toggle.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/dndtreeview.h22
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/dndvbox.h86
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/focus_entry.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/grouped_buttons.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/gtk_ui.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/keyboard.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/motionfeedback.h4
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/persistent_tooltip.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/pixscroller.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/scroomer.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/slider_controller.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/textviewer.h2
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/utils.h10
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/widget_state.h2
-rw-r--r--libs/gtkmm2ext/idle_adjustment.cc4
-rw-r--r--libs/gtkmm2ext/keyboard.cc2
-rw-r--r--libs/gtkmm2ext/motionfeedback.cc30
-rw-r--r--libs/gtkmm2ext/persistent_tooltip.cc4
-rw-r--r--libs/gtkmm2ext/pixscroller.cc12
-rw-r--r--libs/gtkmm2ext/popup.cc4
-rw-r--r--libs/gtkmm2ext/prompter.cc8
-rw-r--r--libs/gtkmm2ext/scroomer.cc26
-rw-r--r--libs/gtkmm2ext/selector.cc2
-rw-r--r--libs/gtkmm2ext/sync-menu.c4
-rw-r--r--libs/gtkmm2ext/tearoff.cc12
-rw-r--r--libs/gtkmm2ext/textviewer.cc2
-rw-r--r--libs/gtkmm2ext/utils.cc24
-rw-r--r--libs/gtkmm2ext/window_title.cc2
-rw-r--r--libs/midi++2/channel.cc8
-rw-r--r--libs/midi++2/ipmidi_port.cc20
-rw-r--r--libs/midi++2/midi++/channel.h10
-rw-r--r--libs/midi++2/midi++/ipmidi_port.h2
-rw-r--r--libs/midi++2/midi++/midnam_patch.h46
-rw-r--r--libs/midi++2/midi++/mmc.h26
-rw-r--r--libs/midi++2/midi++/parser.h12
-rw-r--r--libs/midi++2/midi++/port.h6
-rw-r--r--libs/midi++2/miditrace.cc2
-rw-r--r--libs/midi++2/midnam_patch.cc14
-rw-r--r--libs/midi++2/mmc.cc26
-rw-r--r--libs/midi++2/mmctest.cc2
-rw-r--r--libs/midi++2/mtc.cc44
-rw-r--r--libs/midi++2/parser.cc138
-rw-r--r--libs/midi++2/port.cc8
-rw-r--r--libs/panners/1in2out/panner_1in2out.cc4
-rw-r--r--libs/panners/2in2out/panner_2in2out.cc8
-rw-r--r--libs/panners/2in2out/panner_2in2out.h2
-rw-r--r--libs/pbd/base_ui.cc6
-rw-r--r--libs/pbd/boost_debug.cc20
-rw-r--r--libs/pbd/controllable_descriptor.cc12
-rw-r--r--libs/pbd/convert.cc12
-rw-r--r--libs/pbd/crossthread.posix.cc2
-rw-r--r--libs/pbd/crossthread.win.cc12
-rw-r--r--libs/pbd/debug.cc4
-rw-r--r--libs/pbd/enumwriter.cc10
-rw-r--r--libs/pbd/epa.cc4
-rw-r--r--libs/pbd/event_loop.cc2
-rw-r--r--libs/pbd/ffs.cc2
-rw-r--r--libs/pbd/fpu.cc32
-rw-r--r--libs/pbd/id.cc2
-rw-r--r--libs/pbd/malign.cc4
-rw-r--r--libs/pbd/md5.cc12
-rw-r--r--libs/pbd/mountpoint.cc10
-rw-r--r--libs/pbd/msvc/getopt_long.c4
-rw-r--r--libs/pbd/pathexpand.cc14
-rw-r--r--libs/pbd/pbd.cc4
-rw-r--r--libs/pbd/pbd/abstract_ui.cc20
-rw-r--r--libs/pbd/pbd/abstract_ui.h4
-rw-r--r--libs/pbd/pbd/atomic_counter.h2
-rw-r--r--libs/pbd/pbd/base_ui.h2
-rw-r--r--libs/pbd/pbd/command.h4
-rw-r--r--libs/pbd/pbd/compose.h8
-rw-r--r--libs/pbd/pbd/controllable.h2
-rw-r--r--libs/pbd/pbd/crossthread.h4
-rw-r--r--libs/pbd/pbd/debug_rt_alloc.h2
-rw-r--r--libs/pbd/pbd/destructible.h2
-rw-r--r--libs/pbd/pbd/enumwriter.h2
-rw-r--r--libs/pbd/pbd/epa.h2
-rw-r--r--libs/pbd/pbd/fastlog.h4
-rw-r--r--libs/pbd/pbd/fpu.h4
-rw-r--r--libs/pbd/pbd/functor_command.h2
-rw-r--r--libs/pbd/pbd/id.h2
-rw-r--r--libs/pbd/pbd/md5.h10
-rw-r--r--libs/pbd/pbd/memento_command.h8
-rw-r--r--libs/pbd/pbd/pool.h4
-rw-r--r--libs/pbd/pbd/properties.h22
-rw-r--r--libs/pbd/pbd/property_basics.h14
-rw-r--r--libs/pbd/pbd/property_list.h2
-rw-r--r--libs/pbd/pbd/receiver.h2
-rw-r--r--libs/pbd/pbd/ringbuffer.h32
-rw-r--r--libs/pbd/pbd/ringbufferNPT.h32
-rw-r--r--libs/pbd/pbd/search_path.h4
-rw-r--r--libs/pbd/pbd/selectable.h4
-rw-r--r--libs/pbd/pbd/sequence_property.h16
-rw-r--r--libs/pbd/pbd/signals.h16
-rw-r--r--libs/pbd/pbd/stacktrace.h4
-rw-r--r--libs/pbd/pbd/stateful.h4
-rw-r--r--libs/pbd/pbd/stateful_diff_command.h2
-rw-r--r--libs/pbd/pbd/stl_delete.h4
-rw-r--r--libs/pbd/pbd/touchable.h8
-rw-r--r--libs/pbd/pbd/transmitter.h2
-rw-r--r--libs/pbd/pbd/undo.h10
-rw-r--r--libs/pbd/pbd/unwind.h2
-rw-r--r--libs/pbd/pbd/xml++.h4
-rw-r--r--libs/pbd/pool.cc12
-rw-r--r--libs/pbd/property_list.cc2
-rw-r--r--libs/pbd/pthread_utils.cc8
-rw-r--r--libs/pbd/search_path.cc2
-rw-r--r--libs/pbd/semutils.cc2
-rw-r--r--libs/pbd/shortpath.cc4
-rw-r--r--libs/pbd/stacktrace.cc10
-rw-r--r--libs/pbd/stateful.cc14
-rw-r--r--libs/pbd/strsplit.cc4
-rw-r--r--libs/pbd/system_exec.cc2
-rw-r--r--libs/pbd/test/scalar_properties.cc2
-rw-r--r--libs/pbd/test/scalar_properties.h2
-rw-r--r--libs/pbd/test/signals_test.cc4
-rw-r--r--libs/pbd/test/testrunner.cc8
-rw-r--r--libs/pbd/test/xpath.cc36
-rw-r--r--libs/pbd/textreceiver.cc2
-rw-r--r--libs/pbd/transmitter.cc6
-rw-r--r--libs/pbd/undo.cc2
-rw-r--r--libs/pbd/whitespace.cc10
-rw-r--r--libs/pbd/windows_special_dirs.cc2
-rw-r--r--libs/pbd/xml++.cc22
-rw-r--r--libs/ptformat/ptfformat.cc2
-rw-r--r--libs/qm-dsp/base/Window.h16
-rw-r--r--libs/qm-dsp/dsp/chromagram/Chromagram.cpp10
-rw-r--r--libs/qm-dsp/dsp/chromagram/Chromagram.h8
-rw-r--r--libs/qm-dsp/dsp/chromagram/ConstantQ.cpp12
-rw-r--r--libs/qm-dsp/dsp/chromagram/ConstantQ.h6
-rw-r--r--libs/qm-dsp/dsp/onsets/DetectionFunction.cpp22
-rw-r--r--libs/qm-dsp/dsp/onsets/DetectionFunction.h2
-rw-r--r--libs/qm-dsp/dsp/onsets/PeakPicking.cpp18
-rw-r--r--libs/qm-dsp/dsp/onsets/PeakPicking.h6
-rw-r--r--libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp6
-rw-r--r--libs/qm-dsp/dsp/rateconversion/Decimator.h2
-rw-r--r--libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp26
-rw-r--r--libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.h6
-rw-r--r--libs/qm-dsp/dsp/segmentation/Segmenter.cpp4
-rw-r--r--libs/qm-dsp/dsp/segmentation/Segmenter.h2
-rw-r--r--libs/qm-dsp/dsp/segmentation/cluster_melt.c68
-rw-r--r--libs/qm-dsp/dsp/segmentation/cluster_segmenter.c76
-rw-r--r--libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp16
-rw-r--r--libs/qm-dsp/dsp/signalconditioning/DFProcess.h2
-rw-r--r--libs/qm-dsp/dsp/signalconditioning/FiltFilt.cpp16
-rw-r--r--libs/qm-dsp/dsp/signalconditioning/Filter.h2
-rw-r--r--libs/qm-dsp/dsp/signalconditioning/Framer.cpp8
-rw-r--r--libs/qm-dsp/dsp/tempotracking/DownBeat.cpp2
-rw-r--r--libs/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp8
-rw-r--r--libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp34
-rw-r--r--libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.h2
-rw-r--r--libs/qm-dsp/dsp/tonal/TCSgram.cpp4
-rw-r--r--libs/qm-dsp/dsp/tonal/TCSgram.h2
-rw-r--r--libs/qm-dsp/dsp/tonal/TonalEstimator.cpp20
-rw-r--r--libs/qm-dsp/dsp/tonal/TonalEstimator.h22
-rw-r--r--libs/qm-dsp/dsp/transforms/FFT.cpp2
-rw-r--r--libs/qm-dsp/dsp/wavelet/Wavelet.cpp8
-rw-r--r--libs/qm-dsp/hmm/hmm.c242
-rw-r--r--libs/qm-dsp/maths/MathUtilities.cpp26
-rw-r--r--libs/qm-dsp/maths/MathUtilities.h2
-rw-r--r--libs/qm-dsp/maths/pca/pca.c20
-rw-r--r--libs/surfaces/control_protocol/basic_ui.cc48
-rw-r--r--libs/surfaces/control_protocol/control_protocol.cc4
-rw-r--r--libs/surfaces/control_protocol/control_protocol/basic_ui.h2
-rw-r--r--libs/surfaces/control_protocol/control_protocol/control_protocol.h4
-rw-r--r--libs/surfaces/control_protocol/control_protocol/types.h2
-rw-r--r--libs/surfaces/frontier/kernel_drivers/tests/tranzport.c4
-rw-r--r--libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c4
-rw-r--r--libs/surfaces/frontier/kernel_drivers/tranzport.c12
-rw-r--r--libs/surfaces/frontier/tests/tranzport_lights.c4
-rw-r--r--libs/surfaces/frontier/tranzport/interface.cc4
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc42
-rw-r--r--libs/surfaces/frontier/tranzport/tranzport_control_protocol.h8
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc88
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.h6
-rw-r--r--libs/surfaces/generic_midi/gmcp_gui.cc12
-rw-r--r--libs/surfaces/generic_midi/interface.cc6
-rw-r--r--libs/surfaces/generic_midi/midicontrollable.cc10
-rw-r--r--libs/surfaces/generic_midi/midicontrollable.h4
-rw-r--r--libs/surfaces/generic_midi/midiinvokable.cc2
-rw-r--r--libs/surfaces/generic_midi/midiinvokable.h2
-rw-r--r--libs/surfaces/mackie/button.cc4
-rw-r--r--libs/surfaces/mackie/button.h10
-rw-r--r--libs/surfaces/mackie/control_group.h12
-rw-r--r--libs/surfaces/mackie/controls.cc6
-rw-r--r--libs/surfaces/mackie/controls.h6
-rw-r--r--libs/surfaces/mackie/device_info.cc6
-rw-r--r--libs/surfaces/mackie/device_info.h6
-rw-r--r--libs/surfaces/mackie/device_profile.cc2
-rw-r--r--libs/surfaces/mackie/device_profile.h12
-rw-r--r--libs/surfaces/mackie/fader.cc2
-rw-r--r--libs/surfaces/mackie/fader.h6
-rw-r--r--libs/surfaces/mackie/gui.cc40
-rw-r--r--libs/surfaces/mackie/gui.h4
-rw-r--r--libs/surfaces/mackie/interface.cc6
-rw-r--r--libs/surfaces/mackie/jog_wheel.h2
-rw-r--r--libs/surfaces/mackie/led.cc10
-rw-r--r--libs/surfaces/mackie/led.h4
-rw-r--r--libs/surfaces/mackie/mackie_control_exception.h6
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h32
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc6
-rw-r--r--libs/surfaces/mackie/meter.cc26
-rw-r--r--libs/surfaces/mackie/meter.h2
-rw-r--r--libs/surfaces/mackie/midi_byte_array.cc2
-rw-r--r--libs/surfaces/mackie/midi_byte_array.h4
-rw-r--r--libs/surfaces/mackie/pot.cc6
-rw-r--r--libs/surfaces/mackie/strip.cc148
-rw-r--r--libs/surfaces/mackie/strip.h6
-rw-r--r--libs/surfaces/mackie/surface.cc68
-rw-r--r--libs/surfaces/mackie/surface.h12
-rw-r--r--libs/surfaces/mackie/surface_port.cc10
-rw-r--r--libs/surfaces/mackie/surface_port.h4
-rw-r--r--libs/surfaces/mackie/timer.h6
-rw-r--r--libs/surfaces/mackie/types.h20
-rw-r--r--libs/surfaces/osc/interface.cc2
-rw-r--r--libs/surfaces/osc/osc.h22
-rw-r--r--libs/surfaces/osc/osc_controllable.cc4
-rw-r--r--libs/surfaces/osc/osc_route_observer.cc8
-rw-r--r--libs/surfaces/osc/osc_route_observer.h4
-rw-r--r--libs/surfaces/tranzport/bling.cc2
-rw-r--r--libs/surfaces/tranzport/buttons.cc2
-rw-r--r--libs/surfaces/tranzport/general.cc12
-rw-r--r--libs/surfaces/tranzport/init.cc6
-rw-r--r--libs/surfaces/tranzport/interface.cc4
-rw-r--r--libs/surfaces/tranzport/io.cc6
-rw-r--r--libs/surfaces/tranzport/io_kernel.cc6
-rw-r--r--libs/surfaces/tranzport/io_usb.cc10
-rw-r--r--libs/surfaces/tranzport/lcd.cc4
-rw-r--r--libs/surfaces/tranzport/show.cc14
-rw-r--r--libs/surfaces/tranzport/state.cc2
-rw-r--r--libs/surfaces/tranzport/tranzport_control_protocol.h6
-rw-r--r--libs/surfaces/tranzport/wheel.cc46
-rw-r--r--libs/surfaces/tranzport/wheel_modes.cc12
-rw-r--r--libs/timecode/src/time.cc4
-rw-r--r--libs/timecode/timecode/bbt_time.h10
-rw-r--r--libs/timecode/timecode/time.h8
-rw-r--r--libs/vamp-plugins/AmplitudeFollower.cpp8
-rw-r--r--libs/vamp-plugins/AmplitudeFollower.h4
640 files changed, 5428 insertions, 5428 deletions
diff --git a/libs/appleutility/AUOutputBL.cpp b/libs/appleutility/AUOutputBL.cpp
index 026989afc4..3e6444855a 100644
--- a/libs/appleutility/AUOutputBL.cpp
+++ b/libs/appleutility/AUOutputBL.cpp
@@ -37,7 +37,7 @@
*/
/*=============================================================================
AUOutputBL.h
-
+
=============================================================================*/
#include "AUOutputBL.h"
@@ -79,7 +79,7 @@ AUOutputBL::~AUOutputBL()
void AUOutputBL::Prepare (UInt32 inNumFrames, bool inWantNullBufferIfAllocated)
{
UInt32 channelsPerBuffer = mFormat.IsInterleaved() ? mFormat.NumberChannels() : 1;
-
+
if (mBufferMemory == NULL || inWantNullBufferIfAllocated)
{
mBufferList->mNumberBuffers = mNumberBuffers;
@@ -95,7 +95,7 @@ void AUOutputBL::Prepare (UInt32 inNumFrames, bool inWantNullBufferIfAllocated)
UInt32 nBytes = mFormat.FramesToBytes (inNumFrames);
if ((nBytes * mNumberBuffers) > AllocatedBytes())
throw OSStatus(-10874);//(kAudioUnitErr_TooManyFramesToProcess);
-
+
mBufferList->mNumberBuffers = mNumberBuffers;
AudioBuffer *buf = &mBufferList->mBuffers[0];
Byte* p = mBufferMemory;
@@ -114,25 +114,25 @@ void AUOutputBL::Allocate (UInt32 inNumFrames)
if (inNumFrames)
{
UInt32 nBytes = mFormat.FramesToBytes (inNumFrames);
-
+
if (nBytes <= AllocatedBytes())
return;
-
+
// align successive buffers for Altivec and to take alternating
// cache line hits by spacing them by odd multiples of 16
if (mNumberBuffers > 1)
nBytes = (nBytes + (0x10 - (nBytes & 0xF))) | 0x10;
-
+
mBufferSize = nBytes;
-
+
UInt32 memorySize = mBufferSize * mNumberBuffers;
Byte *newMemory = new Byte[memorySize];
memset(newMemory, 0, memorySize); // make buffer "hot"
-
+
Byte *oldMemory = mBufferMemory;
mBufferMemory = newMemory;
delete[] oldMemory;
-
+
mFrames = inNumFrames;
}
else
diff --git a/libs/appleutility/AUOutputBL.h b/libs/appleutility/AUOutputBL.h
index e76d1bfe28..39887b6a3f 100644
--- a/libs/appleutility/AUOutputBL.h
+++ b/libs/appleutility/AUOutputBL.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
AUOutputBL.h
-
+
=============================================================================*/
#ifndef __AUOutputBL_h__
@@ -61,10 +61,10 @@
class AUOutputBL {
public:
-
+
// you CANNOT use one of these - it will crash!
// AUOutputBL ();
-
+
// this is the constructor that you use
// it can't be reset once you've constructed it
AUOutputBL (const CAStreamBasicDescription &inDesc, UInt32 inDefaultNumFrames = 512);
@@ -74,29 +74,29 @@ public:
{
Prepare (mFrames);
}
-
+
// this version can throw if this is an allocted ABL and inNumFrames is > AllocatedFrames()
// you can set the bool to true if you want a NULL buffer list even if allocated
// inNumFrames must be a valid number (will throw if inNumFrames is 0)
void Prepare (UInt32 inNumFrames, bool inWantNullBufferIfAllocated = false);
-
+
AudioBufferList* ABL() { return mBufferList; }
-
+
// You only need to call this if you want to allocate a buffer list
// if you want an empty buffer list, just call Prepare()
// if you want to dispose previously allocted memory, pass in 0
// then you either have an empty buffer list, or you can re-allocate
// Memory is kept around if an Allocation request is less than what is currently allocated
void Allocate (UInt32 inNumberFrames);
-
+
UInt32 AllocatedFrames() const { return mFrames; }
-
+
const CAStreamBasicDescription& GetFormat() const { return mFormat; }
#if DEBUG
void Print();
#endif
-
+
private:
UInt32 AllocatedBytes () const { return (mBufferSize * mNumberBuffers); }
diff --git a/libs/appleutility/AUParamInfo.cpp b/libs/appleutility/AUParamInfo.cpp
index 15cee0fa34..6379e5642c 100644
--- a/libs/appleutility/AUParamInfo.cpp
+++ b/libs/appleutility/AUParamInfo.cpp
@@ -37,7 +37,7 @@
*/
/*=============================================================================
AUParamInfo.cpp
-
+
=============================================================================*/
#include "AUParamInfo.h"
#include "CAXException.h"
@@ -56,14 +56,14 @@ AUParamInfo::AUParamInfo (AudioUnit inAU,
UInt32 size;
OSStatus result = AudioUnitGetPropertyInfo(mAU, kAudioUnitProperty_ParameterList, inScope, mElement, &size, NULL);
if (size == 0 || result) return;
-
+
int nparams = size / sizeof(AudioUnitPropertyID);
mParamListID = new AudioUnitParameterID[nparams];
memset (mParamListID, 0xFF, size);
AudioUnitParameterID *paramList = new AudioUnitParameterID[nparams];
-
+
result = AudioUnitGetProperty(mAU, kAudioUnitProperty_ParameterList, mScope, mElement, paramList, &size);
if (result) {
delete [] mParamListID;
@@ -71,13 +71,13 @@ AUParamInfo::AUParamInfo (AudioUnit inAU,
mParamListID = NULL;
return;
}
-
+
ParameterMap params;
for (int i = 0; i < nparams; ++i)
{
CAAUParameter auvp (mAU, paramList[i], mScope, mElement); // took out only using global scope in CAAUParameter creation
const AudioUnitParameterInfo &paramInfo = auvp.ParamInfo();
-
+
// don't include if parameter can't be read or written
if (!(paramInfo.flags & kAudioUnitParameterFlag_IsWritable)
&& !(paramInfo.flags & kAudioUnitParameterFlag_IsReadable))
@@ -86,18 +86,18 @@ AUParamInfo::AUParamInfo (AudioUnit inAU,
// only include if expert params wanted
if (!inIncludeExpert && auvp.IsExpert())
continue;
-
+
// only include if read only params are wanted
if (!(paramInfo.flags & kAudioUnitParameterFlag_IsWritable)
&& (paramInfo.flags & kAudioUnitParameterFlag_IsReadable))
- {
+ {
if (!inIncludeReadOnly)
continue;
}
-
+
mParamListID[mNumParams] = paramList[i];
mNumParams++;
-
+
// ok - if we're here, then we have a parameter we are going to display.
UInt32 clump = 0;
auvp.GetClumpID (clump);
diff --git a/libs/appleutility/AUParamInfo.h b/libs/appleutility/AUParamInfo.h
index b5f7c26345..e20e14b259 100644
--- a/libs/appleutility/AUParamInfo.h
+++ b/libs/appleutility/AUParamInfo.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
AUParamInfo.h
-
+
=============================================================================*/
#include <map>
#include <vector>
@@ -48,7 +48,7 @@
The ParameterMap returned by the Map() method is a map where
- the key is the clumpID
- the value is a ParameterList (vector<CAAUParameter>)
-
+
If you have parameters on multiple scopes (or elements within a scope), then you should create one of these
for each scope-element pair
*/
@@ -66,40 +66,40 @@ public:
bool inIncludeReadOnly,
AudioUnitScope inScope = kAudioUnitScope_Global,
AudioUnitElement inElement = 0);
-
+
~AUParamInfo();
-
+
const ParameterMap& Map () const { return mParams; }
-
+
// some convenience methods
UInt32 NumParams () const { return mNumParams; }
-
+
AudioUnitParameterID ParamID (UInt32 inIndex) const
{
if (inIndex < mNumParams) return mParamListID[inIndex];
return 0xFFFFFFFF;
}
-
+
UInt32 NumClumps () const { return mParams.size(); }
UInt32 NumParamsForClump (UInt32 inClump) const;
-
+
// returns NULL if there's no info for the parameter
const CAAUParameter* GetParamInfo (AudioUnitParameterID inParamID) const;
-
+
AudioUnitScope GetScope () const { return mScope; }
AudioUnitElement GetElement () const { return mElement; }
-
+
private:
AudioUnit mAU;
UInt32 mNumParams;
AudioUnitParameterID * mParamListID;
-
+
ParameterMap mParams;
AudioUnitScope mScope;
AudioUnitElement mElement;
-
+
// disallow
AUParamInfo () {}
AUParamInfo (const AUParamInfo &) {}
diff --git a/libs/appleutility/CAAUParameter.cpp b/libs/appleutility/CAAUParameter.cpp
index 1050ecfe1b..4953a3cd23 100644
--- a/libs/appleutility/CAAUParameter.cpp
+++ b/libs/appleutility/CAAUParameter.cpp
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAAUParameter.cpp
-
+
=============================================================================*/
#include "CAAUParameter.h"
@@ -70,13 +70,13 @@ CAAUParameter & CAAUParameter::operator = (const CAAUParameter &a)
if (mParamName) CFRelease(mParamName);
if (mParamTag) CFRelease(mParamTag);
if (mNamedParams) CFRelease(mNamedParams);
-
+
memcpy(this, &a, sizeof(CAAUParameter));
if (mParamName) CFRetain(mParamName);
if (mParamTag) CFRetain(mParamTag);
if (mNamedParams) CFRetain(mNamedParams);
-
+
return *this;
}
@@ -93,7 +93,7 @@ void CAAUParameter::Init (AudioUnit au, AudioUnitParameterID param, AudioUnitSc
mParameterID = param;
mScope = scope;
mElement = element;
-
+
UInt32 propertySize = sizeof(mParamInfo);
OSStatus err = AudioUnitGetProperty(au, kAudioUnitProperty_ParameterInfo,
scope, param, &mParamInfo, &propertySize);
@@ -105,7 +105,7 @@ void CAAUParameter::Init (AudioUnit au, AudioUnitParameterID param, AudioUnitSc
CFRetain (mParamName);
} else
mParamName = CFStringCreateWithCString(NULL, mParamInfo.name, kCFStringEncodingUTF8);
-
+
char* str = 0;
switch (mParamInfo.unit)
{
@@ -204,7 +204,7 @@ void CAAUParameter::Init (AudioUnit au, AudioUnitParameterID param, AudioUnitSc
str = NULL;
break;
}
-
+
if (str)
mParamTag = CFStringCreateWithCString(NULL, str, kCFStringEncodingUTF8);
else
@@ -239,18 +239,18 @@ CFStringRef CAAUParameter::GetStringFromValueCopy(const Float32 *value) const
stringValue.inValue = value;
stringValue.outString = NULL;
UInt32 propertySize = sizeof(stringValue);
-
+
OSStatus err = AudioUnitGetProperty (mAudioUnit,
kAudioUnitProperty_ParameterStringFromValue,
mScope,
mParameterID,
&stringValue,
&propertySize);
-
+
if (err == noErr && stringValue.outString != NULL)
return stringValue.outString;
}
-
+
Float32 val = (value == NULL ? GetValue() : *value);
char valstr[32];
AUParameterFormatValue (val, this, valstr, 4);
@@ -265,19 +265,19 @@ Float32 CAAUParameter::GetValueFromString(CFStringRef str) const
valueString.inParamID = mParameterID;
valueString.inString = str;
UInt32 propertySize = sizeof(valueString);
-
+
OSStatus err = AudioUnitGetProperty (mAudioUnit,
kAudioUnitProperty_ParameterValueFromString,
mScope,
mParameterID,
&valueString,
&propertySize);
-
+
if (err == noErr) {
return valueString.outValue;
}
}
-
+
Float32 paramValue = mParamInfo.defaultValue;
char valstr[32];
CFStringGetCString(str, valstr, sizeof(valstr), kCFStringEncodingUTF8);
@@ -304,12 +304,12 @@ void CAAUParameter::Print() const
{
UInt32 clump = 0;
GetClumpID (clump);
-
+
UInt32 len = CFStringGetLength(mParamName);
char* chars = (char*)malloc (len * 2); // give us plenty of room for unichar chars
if (!CFStringGetCString (mParamName, chars, len * 2, kCFStringEncodingUTF8))
chars[0] = 0;
-
+
printf ("ID: %ld, Clump: %ld, Name: %s\n", mParameterID, clump, chars);
free (chars);
}
diff --git a/libs/appleutility/CAAUParameter.h b/libs/appleutility/CAAUParameter.h
index 143a798006..82d75e560b 100644
--- a/libs/appleutility/CAAUParameter.h
+++ b/libs/appleutility/CAAUParameter.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAAUParameter.h
-
+
=============================================================================*/
#ifndef __CAAUParameter_h__
@@ -61,7 +61,7 @@ public:
CAAUParameter(const CAAUParameter &a);
/*! @dtor ~CAAUParameter */
~CAAUParameter();
-
+
/*! @method operator <@ */
bool operator < (const CAAUParameter &a) const
{
@@ -73,23 +73,23 @@ public:
{
return !memcmp(this, &a, sizeof(AudioUnitParameter));
}
-
+
/*! @method operator =@ */
CAAUParameter & operator = (const CAAUParameter &a);
-
+
/*! @method GetValue */
Float32 GetValue() const;
/*! @method SetValue */
void SetValue( AUParameterListenerRef inListener,
void * inObject,
Float32 inValue) const;
-
+
/*! @method GetName */
CFStringRef GetName() const { return mParamName; }
// borrowed reference!
/*! @method GetStringFromValueCopy */
- CFStringRef GetStringFromValueCopy(const Float32 *value = NULL) const;
+ CFStringRef GetStringFromValueCopy(const Float32 *value = NULL) const;
// returns a copy of the name of the current parameter value
// or null if there is no name associated
// caller must release
@@ -98,13 +98,13 @@ public:
{
return (mParamInfo.flags & kAudioUnitParameterFlag_ValuesHaveStrings) != 0;
}
-
+
/*! @method GetValueFromString */
- Float32 GetValueFromString (CFStringRef str) const;
+ Float32 GetValueFromString (CFStringRef str) const;
// caller must release
/*! @method ParamInfo */
- const AudioUnitParameterInfo &
+ const AudioUnitParameterInfo &
ParamInfo() const { return mParamInfo; }
/*! @method GetParamTag */
@@ -120,16 +120,16 @@ public:
? (CFStringRef) CFArrayGetValueAtIndex(mNamedParams, inIndex)
: 0;
}
-
+
/*! @method GetNumIndexedParams */
int GetNumIndexedParams () const { return mNumIndexedParams; }
-
+
/*! @method IsIndexedParam */
bool IsIndexedParam () const { return mNumIndexedParams != 0; }
-
+
/*! @method HasNamedParams */
bool HasNamedParams () const { return IsIndexedParam() && mNamedParams; }
-
+
/*! @method GetClumpID */
bool GetClumpID (UInt32 &outClumpID) const
{
@@ -139,7 +139,7 @@ public:
}
return false;
}
-
+
/*! @method HasDisplayTransformation */
bool HasDisplayTransformation () const
{
@@ -154,14 +154,14 @@ public:
#if DEBUG
void Print () const;
#endif
-
+
// these methods are defined in CAPersistence.cpp
// they will persist and restore only the scope, element and param ID's of the AudioUnitParameter
// however, this is sufficient to be able to save/restore a CAAUParameter object
void Save (CFPropertyListRef &outData) const;
-
+
static void Save (const AudioUnitParameter &inParam, CFPropertyListRef &outData);
-
+
static OSStatus Restore (const CFPropertyListRef inData, AudioUnitParameter &outParam);
protected:
@@ -176,7 +176,7 @@ protected:
short mNumIndexedParams;
/*! @var mNamedParams */
CFArrayRef mNamedParams;
-
+
private:
void Init (AudioUnit au, AudioUnitParameterID param, AudioUnitScope scope, AudioUnitElement element);
diff --git a/libs/appleutility/CAAudioChannelLayout.cpp b/libs/appleutility/CAAudioChannelLayout.cpp
index 585ff44fb7..5ca0b76ca0 100644
--- a/libs/appleutility/CAAudioChannelLayout.cpp
+++ b/libs/appleutility/CAAudioChannelLayout.cpp
@@ -90,10 +90,10 @@ bool operator== (const AudioChannelLayout &x, const AudioChannelLayout &y)
// (this may be too strict a comparison if all you care about are matching layout tags)
UInt32 theSize1 = CAAudioChannelLayout::CalculateByteSize(x.mNumberChannelDescriptions);
UInt32 theSize2 = CAAudioChannelLayout::CalculateByteSize(y.mNumberChannelDescriptions);
-
+
if (theSize1 != theSize2)
return false;
-
+
return !memcmp (&x, &y, theSize1);
}
@@ -115,7 +115,7 @@ UInt32 CAAudioChannelLayout::NumberChannels (const AudioChannelLayout& inLayout)
{
if (inLayout.mChannelLayoutTag == kAudioChannelLayoutTag_UseChannelDescriptions)
return inLayout.mNumberChannelDescriptions;
-
+
if (inLayout.mChannelLayoutTag == kAudioChannelLayoutTag_UseChannelBitmap)
return CountOnes (inLayout.mChannelBitmap);
diff --git a/libs/appleutility/CAAudioChannelLayout.h b/libs/appleutility/CAAudioChannelLayout.h
index 7db75ad7e0..388f087ef9 100644
--- a/libs/appleutility/CAAudioChannelLayout.h
+++ b/libs/appleutility/CAAudioChannelLayout.h
@@ -81,9 +81,9 @@ public:
}
static void SetAllToUnknown(AudioChannelLayout& outChannelLayout, UInt32 inNumberChannelDescriptions);
static UInt32 NumberChannels(const AudioChannelLayout& inLayout);
-
+
#if !HAL_Build
-// object methods
+// object methods
public:
CAAudioChannelLayout ();
@@ -96,7 +96,7 @@ public:
CAAudioChannelLayout (const CAAudioChannelLayout &c);
CAAudioChannelLayout (const AudioChannelLayout* inChannelLayout);
~CAAudioChannelLayout();
-
+
CAAudioChannelLayout& operator= (const AudioChannelLayout* inChannelLayout);
CAAudioChannelLayout& operator= (const CAAudioChannelLayout& c);
bool operator== (const CAAudioChannelLayout &c) const;
@@ -105,19 +105,19 @@ public:
bool IsValid() const { return NumberChannels() > 0; }
UInt32 Size() const { return mLayoutHolder ? mLayoutHolder->Size() : 0; }
-
+
UInt32 NumberChannels() const { return NumberChannels(Layout()); }
-
+
AudioChannelLayoutTag Tag() const { return Layout().mChannelLayoutTag; }
const AudioChannelLayout& Layout() const { return mLayoutHolder->Layout(); }
operator const AudioChannelLayout *() const { return &Layout(); }
-
+
void Print () const { Print (stdout); }
void Print (FILE* file) const;
OSStatus Save (CFPropertyListRef *outData) const;
OSStatus Restore (CFPropertyListRef &inData);
-
+
private:
class ACLRefCounter : public CAReferenceCounted {
public:
@@ -125,35 +125,35 @@ private:
{
if (inDataSize < offsetof(AudioChannelLayout, mChannelDescriptions))
inDataSize = offsetof(AudioChannelLayout, mChannelDescriptions);
-
+
mLayout = static_cast<AudioChannelLayout*>(malloc (inDataSize));
memset (mLayout, 0, inDataSize);
mByteSize = inDataSize;
}
-
+
const AudioChannelLayout & Layout() const { return *mLayout; }
-
+
UInt32 Size () const { return mByteSize; }
-
+
private:
AudioChannelLayout *mLayout;
UInt32 mByteSize;
-
+
// only the constructors can change the actual state of the layout
friend CAAudioChannelLayout::CAAudioChannelLayout (UInt32 inNumberChannels, bool inChooseSurround);
friend OSStatus CAAudioChannelLayout::Restore (CFPropertyListRef &inData);
friend CAAudioChannelLayout& CAAudioChannelLayout::operator= (const AudioChannelLayout* inChannelLayout);
friend void CAAudioChannelLayout::SetWithTag(AudioChannelLayoutTag inTag);
-
+
AudioChannelLayout * GetLayout() { return mLayout; }
~ACLRefCounter() { if (mLayout) { free(mLayout); mLayout = NULL; } }
-
+
private:
ACLRefCounter () : mLayout(NULL) { }
ACLRefCounter(const ACLRefCounter& other) : CAReferenceCounted (other), mLayout(NULL) { }
ACLRefCounter& operator=(const ACLRefCounter&) { return *this; }
};
-
+
ACLRefCounter *mLayoutHolder;
#endif // HAL_Build
diff --git a/libs/appleutility/CAAudioChannelLayoutObject.cpp b/libs/appleutility/CAAudioChannelLayoutObject.cpp
index 64a452d6b6..9e3cf586e9 100644
--- a/libs/appleutility/CAAudioChannelLayoutObject.cpp
+++ b/libs/appleutility/CAAudioChannelLayoutObject.cpp
@@ -59,16 +59,16 @@ CAAudioChannelLayout::CAAudioChannelLayout ()
// CAAudioChannelLayout::CAAudioChannelLayout
//=============================================================================
CAAudioChannelLayout::CAAudioChannelLayout (UInt32 inNumberChannels, bool inChooseSurround)
-{
+{
// this chooses default layouts based on the number of channels...
UInt32 theSize = CalculateByteSize (inNumberChannels);
-
+
mLayoutHolder = new ACLRefCounter (theSize);
-
+
AudioChannelLayout* layout = mLayoutHolder->GetLayout();
layout->mNumberChannelDescriptions = inNumberChannels;
-
+
switch (inNumberChannels)
{
case 1:
@@ -148,11 +148,11 @@ CAAudioChannelLayout& CAAudioChannelLayout::operator= (const CAAudioChannelLayou
if (mLayoutHolder != c.mLayoutHolder) {
if (mLayoutHolder)
mLayoutHolder->release();
-
+
if ((mLayoutHolder = c.mLayoutHolder) != NULL)
mLayoutHolder->retain();
}
-
+
return *this;
}
@@ -162,9 +162,9 @@ CAAudioChannelLayout& CAAudioChannelLayout::operator= (const AudioChannelLayout*
mLayoutHolder->release();
UInt32 theSize = CalculateByteSize (inChannelLayout->mNumberChannelDescriptions);
-
+
mLayoutHolder = new ACLRefCounter (theSize);
-
+
memcpy(mLayoutHolder->mLayout, inChannelLayout, theSize);
return *this;
}
@@ -173,7 +173,7 @@ void CAAudioChannelLayout::SetWithTag(AudioChannelLayoutTag inTag)
{
if (mLayoutHolder)
mLayoutHolder->release();
-
+
mLayoutHolder = new ACLRefCounter(offsetof(AudioChannelLayout, mChannelDescriptions[0]));
AudioChannelLayout* layout = mLayoutHolder->GetLayout();
layout->mChannelLayoutTag = inTag;
diff --git a/libs/appleutility/CAAudioFile.cpp b/libs/appleutility/CAAudioFile.cpp
index 1e97de6211..148565e7fb 100644
--- a/libs/appleutility/CAAudioFile.cpp
+++ b/libs/appleutility/CAAudioFile.cpp
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAAudioFile.cpp
-
+
=============================================================================*/
#include "CAAudioFile.h"
@@ -88,13 +88,13 @@
if (sIndent == 0)
printf("\n");
}
-
+
static void Indent() {
for (int i = sIndent; --i >= 0; ) {
putchar(' '); putchar(' ');
}
}
-
+
const char *mName;
static int sIndent;
};
@@ -126,7 +126,7 @@ CAAudioFile::CAAudioFile() :
mMode(kClosed),
mFileDataOffset(-1),
mFramesToSkipFollowingSeek(0),
-
+
mClientOwnsIOBuffer(false),
mPacketDescs(NULL),
mNumPacketDescs(0),
@@ -229,7 +229,7 @@ void CAAudioFile::CreateNew(const FSRef &parentDir, CFStringRef filename, AudioF
{
LOG_FUNCTION("CAAudioFile::CreateNew", "%p", this);
XThrowIf(mMode != kClosed, kExtAudioFileError_InvalidOperationOrder, "file already open");
-
+
mFileDataFormat = dataFormat;
if (layout) {
mFileChannelLayout = layout;
@@ -249,15 +249,15 @@ void CAAudioFile::FileFormatChanged(const FSRef *parentDir, CFStringRef filename
{
LOG_FUNCTION("CAAudioFile::FileFormatChanged", "%p", this);
XThrowIf(mMode != kPreparingToCreate && mMode != kPreparingToWrite, kExtAudioFileError_InvalidOperationOrder, "new file not prepared");
-
+
UInt32 propertySize;
OSStatus err;
AudioStreamBasicDescription saveFileDataFormat = mFileDataFormat;
-
+
#if VERBOSE_CONVERTER
mFileDataFormat.PrintFormat(stdout, "", "Specified file data format");
#endif
-
+
// Find out the actual format the converter will produce. This is necessary in
// case the bitrate has forced a lower sample rate, which needs to be set correctly
// in the stream description passed to AudioFileCreate.
@@ -286,7 +286,7 @@ void CAAudioFile::FileFormatChanged(const FSRef *parentDir, CFStringRef filename
free(layout);
}
}
-
+
// create the output file
if (mMode == kPreparingToCreate) {
CAStreamBasicDescription newFileDataFormat = mFileDataFormat;
@@ -314,12 +314,12 @@ void CAAudioFile::FileFormatChanged(const FSRef *parentDir, CFStringRef filename
if (mConverter != NULL) {
// encoder
- // get the magic cookie, if any, from the converter
+ // get the magic cookie, if any, from the converter
delete[] mMagicCookie; mMagicCookie = NULL;
mMagicCookieSize = 0;
err = AudioConverterGetPropertyInfo(mConverter, kAudioConverterCompressionMagicCookie, &propertySize, NULL);
-
+
// we can get a noErr result and also a propertySize == 0
// -- if the file format does support magic cookies, but this file doesn't have one.
if (err == noErr && propertySize > 0) {
@@ -338,7 +338,7 @@ void CAAudioFile::FileFormatChanged(const FSRef *parentDir, CFStringRef filename
XThrowIfError(AudioFileSetProperty(mAudioFile, kAudioFilePropertyMagicCookieData, mMagicCookieSize, mMagicCookie), "set audio file's magic cookie");
}
}
-
+
// get maximum packet size
propertySize = sizeof(UInt32);
XThrowIfError(AudioConverterGetProperty(mConverter, kAudioConverterPropertyMaximumOutputPacketSize, &propertySize, &mFileMaxPacketSize), "get audio converter's maximum output packet size");
@@ -347,7 +347,7 @@ void CAAudioFile::FileFormatChanged(const FSRef *parentDir, CFStringRef filename
} else {
InitFileMaxPacketSize();
}
-
+
if (mFileChannelLayout.IsValid() && mFileChannelLayout.NumberChannels() > 2) {
// don't bother tagging mono/stereo files
UInt32 isWritable;
@@ -366,7 +366,7 @@ void CAAudioFile::FileFormatChanged(const FSRef *parentDir, CFStringRef filename
#endif
}
}
-
+
UpdateClientMaxPacketSize(); // also sets mFrame0Offset
mPacketMark = 0;
mFrameMark = 0;
@@ -429,11 +429,11 @@ void CAAudioFile::GetExistingFileInfo()
LOG_FUNCTION("CAAudioFile::GetExistingFileInfo", "%p", this);
UInt32 propertySize;
OSStatus err;
-
+
// get mFileDataFormat
propertySize = sizeof(AudioStreamBasicDescription);
XThrowIfError(AudioFileGetProperty(mAudioFile, kAudioFilePropertyDataFormat, &propertySize, &mFileDataFormat), "get audio file's data format");
-
+
// get mFileChannelLayout
err = AudioFileGetPropertyInfo(mAudioFile, kAudioFilePropertyChannelLayout, &propertySize, NULL);
if (err == noErr && propertySize > 0) {
@@ -450,7 +450,7 @@ void CAAudioFile::GetExistingFileInfo()
}
if (mMode != kReading)
return;
-
+
#if 0
// get mNumberPackets
propertySize = sizeof(mNumberPackets);
@@ -459,7 +459,7 @@ void CAAudioFile::GetExistingFileInfo()
printf("CAAudioFile::GetExistingFileInfo: %qd packets\n", mNumberPackets);
#endif
#endif
-
+
// get mMagicCookie
err = AudioFileGetPropertyInfo(mAudioFile, kAudioFilePropertyMagicCookieData, &propertySize, NULL);
if (err == noErr && propertySize > 0) {
@@ -470,7 +470,7 @@ void CAAudioFile::GetExistingFileInfo()
InitFileMaxPacketSize();
mPacketMark = 0;
mFrameMark = 0;
-
+
UpdateClientMaxPacketSize();
}
@@ -495,9 +495,9 @@ void CAAudioFile::SetClientFormat(const CAStreamBasicDescription &dataFormat, co
{
LOG_FUNCTION("CAAudioFile::SetClientFormat", "%p", this);
XThrowIf(!dataFormat.IsPCM(), kExtAudioFileError_NonPCMClientFormat, "non-PCM client format on audio file");
-
+
bool dataFormatChanging = (mClientDataFormat.mFormatID == 0 || mClientDataFormat != dataFormat);
-
+
if (dataFormatChanging) {
CloseConverter();
if (mWriteBufferList) {
@@ -506,12 +506,12 @@ void CAAudioFile::SetClientFormat(const CAStreamBasicDescription &dataFormat, co
}
mClientDataFormat = dataFormat;
}
-
+
if (layout && layout->IsValid()) {
XThrowIf(layout->NumberChannels() != mClientDataFormat.NumberChannels(), kExtAudioFileError_InvalidChannelMap, "inappropriate channel map");
mClientChannelLayout = *layout;
}
-
+
bool differentLayouts;
if (mClientChannelLayout.IsValid()) {
if (mFileChannelLayout.IsValid()) {
@@ -534,7 +534,7 @@ void CAAudioFile::SetClientFormat(const CAStreamBasicDescription &dataFormat, co
printf("two invalid layouts\n");
#endif
}
-
+
if (mClientDataFormat != mFileDataFormat || differentLayouts) {
// We need an AudioConverter.
if (mMode == kReading) {
@@ -545,7 +545,7 @@ void CAAudioFile::SetClientFormat(const CAStreamBasicDescription &dataFormat, co
if (mConverter == NULL)
XThrowIfError(AudioConverterNew(&mFileDataFormat, &mClientDataFormat, &mConverter),
"create audio converter");
-
+
#if VERBOSE_CONVERTER
printf("CAAudioFile %p -- created converter\n", this);
CAShow(mConverter);
@@ -558,7 +558,7 @@ void CAAudioFile::SetClientFormat(const CAStreamBasicDescription &dataFormat, co
SetConverterChannelLayout(false, mFileChannelLayout);
SetConverterChannelLayout(true, mClientChannelLayout);
-
+
// propagate leading/trailing frame counts
if (mFileDataFormat.mBitsPerChannel == 0) {
UInt32 propertySize;
@@ -592,7 +592,7 @@ void CAAudioFile::SetClientFormat(const CAStreamBasicDescription &dataFormat, co
// _______________________________________________________________________________________
//
-OSStatus CAAudioFile::SetConverterProperty(
+OSStatus CAAudioFile::SetConverterProperty(
AudioConverterPropertyID inPropertyID,
UInt32 inPropertyDataSize,
const void* inPropertyData,
@@ -620,7 +620,7 @@ void CAAudioFile::SetConverterChannelLayout(bool output, const CAAudioChannelLay
{
LOG_FUNCTION("CAAudioFile::SetConverterChannelLayout", "%p", this);
OSStatus err;
-
+
if (layout.IsValid()) {
#if VERBOSE_CHANNELMAP
printf("Setting converter's %s channel layout: %s\n", output ? "output" : "input",
@@ -660,11 +660,11 @@ void CAAudioFile::UpdateClientMaxPacketSize()
AudioConverterPropertyID property = (mMode == kReading) ?
kAudioConverterPropertyMaximumOutputPacketSize :
kAudioConverterPropertyMaximumInputPacketSize;
-
+
UInt32 propertySize = sizeof(UInt32);
XThrowIfError(AudioConverterGetProperty(mConverter, property, &propertySize, &mClientMaxPacketSize),
"get audio converter's maximum packet size");
-
+
if (mFileDataFormat.mBitsPerChannel == 0) {
AudioConverterPrimeInfo primeInfo;
propertySize = sizeof(primeInfo);
@@ -693,7 +693,7 @@ void CAAudioFile::AllocateBuffers(bool okToFail)
}
UInt32 bufferSizeBytes = mIOBufferSizeBytes = std::max(mIOBufferSizeBytes, mFileMaxPacketSize);
// must be big enough for at least one maximum size packet
-
+
if (mIOBufferList.mBuffers[0].mDataByteSize != bufferSizeBytes) {
mIOBufferList.mNumberBuffers = 1;
mIOBufferList.mBuffers[0].mNumberChannels = mFileDataFormat.mChannelsPerFrame;
@@ -705,7 +705,7 @@ void CAAudioFile::AllocateBuffers(bool okToFail)
mIOBufferList.mBuffers[0].mDataByteSize = bufferSizeBytes;
mIOBufferSizePackets = bufferSizeBytes / mFileMaxPacketSize;
}
-
+
UInt32 propertySize = sizeof(UInt32);
UInt32 externallyFramed;
XThrowIfError(AudioFormatGetProperty(kAudioFormatProperty_FormatIsExternallyFramed,
@@ -766,7 +766,7 @@ SInt64 CAAudioFile::PacketToFrame(SInt64 packet) const
{
AudioFramePacketTranslation trans;
UInt32 propertySize;
-
+
switch (mFileDataFormat.mFramesPerPacket) {
case 1:
return packet;
@@ -784,7 +784,7 @@ SInt64 CAAudioFile::FrameToPacket(SInt64 inFrame) const
{
AudioFramePacketTranslation trans;
UInt32 propertySize;
-
+
switch (mFileDataFormat.mFramesPerPacket) {
case 1:
return inFrame;
@@ -815,7 +815,7 @@ void CAAudioFile::SeekToPacket(SInt64 packetNumber)
if (mPacketMark == packetNumber)
return; // already there! don't reset converter
mPacketMark = packetNumber;
-
+
mFrameMark = PacketToFrame(packetNumber) - mFrame0Offset;
mFramesToSkipFollowingSeek = 0;
if (mConverter)
@@ -825,7 +825,7 @@ void CAAudioFile::SeekToPacket(SInt64 packetNumber)
/*
Example: AAC, 1024 frames/packet, 2112 frame offset
-
+
2112
|
Absolute frames: 0 1024 2048 | 3072
@@ -838,7 +838,7 @@ void CAAudioFile::SeekToPacket(SInt64 packetNumber)
* Offset between absolute and client frames is mFrame0Offset.
*** mFrameMark is in client frames ***
-
+
Examples:
clientFrame 0 960 1000 1024
absoluteFrame 2112 3072 3112 3136
@@ -857,7 +857,7 @@ void CAAudioFile::Seek(SInt64 clientFrame)
#if VERBOSE_IO
SInt64 prevFrameMark = mFrameMark;
#endif
-
+
SInt64 packet;
packet = FrameToPacket(clientFrame);
if (packet < 0)
@@ -866,7 +866,7 @@ void CAAudioFile::Seek(SInt64 clientFrame)
// this will have backed up mFrameMark to match the beginning of the packet
mFramesToSkipFollowingSeek = std::max(UInt32(clientFrame - mFrameMark), UInt32(0));
mFrameMark = clientFrame;
-
+
#if VERBOSE_IO
printf("CAAudioFile::SeekToFrame: frame %qd (from %qd), packet %qd, skip %ld frames\n", mFrameMark, prevFrameMark, packet, mFramesToSkipFollowingSeek);
#endif
@@ -889,12 +889,12 @@ void CAAudioFile::Read(UInt32 &ioNumPackets, AudioBufferList *ioData)
AllocateBuffers();
}
UInt32 bufferSizeBytes = ioData->mBuffers[0].mDataByteSize;
- UInt32 maxNumPackets = bufferSizeBytes / mClientMaxPacketSize;
+ UInt32 maxNumPackets = bufferSizeBytes / mClientMaxPacketSize;
// older versions of AudioConverterFillComplexBuffer don't do this, so do our own sanity check
UInt32 nPackets = std::min(ioNumPackets, maxNumPackets);
-
+
mMaxPacketsToRead = ~0UL;
-
+
if (mClientDataFormat.mFramesPerPacket == 1) { // PCM or equivalent
while (mFramesToSkipFollowingSeek > 0) {
UInt32 skipFrames = std::min(mFramesToSkipFollowingSeek, maxNumPackets);
@@ -931,7 +931,7 @@ void CAAudioFile::Read(UInt32 &ioNumPackets, AudioBufferList *ioData)
ioData->mBuffers[i].mDataByteSize = bufferSizeBytes;
}
}
-
+
if (mFileDataFormat.mFramesPerPacket > 0)
// don't read more packets than we are being asked to produce
mMaxPacketsToRead = nPackets / mFileDataFormat.mFramesPerPacket + 1;
@@ -950,7 +950,7 @@ void CAAudioFile::Read(UInt32 &ioNumPackets, AudioBufferList *ioData)
}
if (mClientDataFormat.mFramesPerPacket == 1)
mFrameMark += nPackets;
-
+
ioNumPackets = nPackets;
}
@@ -977,7 +977,7 @@ OSStatus CAAudioFile::ReadInputProc( AudioConverterRef inAudioConverter,
return noErr; // not eofErr; EOF is signified by 0 packets/0 bytes
}
#endif
-
+
// determine how much to read
AudioBufferList *readBuffer;
UInt32 readPackets;
@@ -1003,11 +1003,11 @@ OSStatus CAAudioFile::ReadInputProc( AudioConverterRef inAudioConverter,
#endif
readPackets = This->mMaxPacketsToRead;
}
-
+
// read
UInt32 bytesRead;
OSStatus err;
-
+
StartTiming(This, read);
StartTiming(This, readinconv);
err = AudioFileReadPackets(This->mAudioFile, This->mUseCache, &bytesRead, This->mPacketDescs, This->mPacketMark, &readPackets, readBuffer->mBuffers[0].mData);
@@ -1020,7 +1020,7 @@ OSStatus CAAudioFile::ReadInputProc( AudioConverterRef inAudioConverter,
DebugMessageN1("Error %ld from AudioFileReadPackets!!!\n", err);
return err;
}
-
+
#if VERBOSE_IO
printf("CAAudioFile::ReadInputProc: read %ld packets (%qd-%qd), %ld bytes, err %ld\n", readPackets, This->mPacketMark, This->mPacketMark + readPackets, bytesRead, err);
#if VERBOSE_IO >= 2
@@ -1108,7 +1108,7 @@ void CAAudioFile::FlushEncoder()
OSStatus err;
AudioConverterPrimeInfo primeInfo;
propertySize = sizeof(primeInfo);
-
+
err = AudioConverterGetProperty(mConverter, kAudioConverterPrimeInfo, &propertySize, &primeInfo);
if (err == noErr) {
AudioFilePacketTableInfo pti;
@@ -1165,9 +1165,9 @@ static void hexdump(const void *addr, long len)
{
const Byte *p = (Byte *)addr;
UInt32 offset = 0;
-
+
if (len > 0x400) len = 0x400;
-
+
while (len > 0) {
int n = len > 16 ? 16 : len;
printf("%08lX: ", offset);
diff --git a/libs/appleutility/CAAudioFile.h b/libs/appleutility/CAAudioFile.h
index 594545a9d1..8dd1d8690b 100644
--- a/libs/appleutility/CAAudioFile.h
+++ b/libs/appleutility/CAAudioFile.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAAudioFile.h
-
+
=============================================================================*/
#ifndef __CAAudioFile_h__
@@ -122,7 +122,7 @@ public:
// open an existing file
XThrowIfError(ExtAudioFileOpen(&fsref, &mExtAF), "ExtAudioFileOpen failed");
}
-
+
void CreateNew(const FSRef &inParentDir, CFStringRef inFileName, AudioFileTypeID inFileType, const AudioStreamBasicDescription &inStreamDesc, const AudioChannelLayout *inChannelLayout=NULL) {
XThrowIfError(ExtAudioFileCreateNew(&inParentDir, inFileName, inFileType, &inStreamDesc, inChannelLayout, &mExtAF), "ExtAudioFileCreateNew failed");
}
@@ -131,7 +131,7 @@ public:
// use this to wrap an AudioFileID opened externally
XThrowIfError(ExtAudioFileWrapAudioFileID(fileID, forWriting, &mExtAF), "ExtAudioFileWrapAudioFileID failed");
}
-
+
void Close() {
std::cerr << "\tdisposeo of ext audio file @ " << mExtAF << std::endl;
XThrowIfError(ExtAudioFileDispose(mExtAF), "ExtAudioFileClose failed");
@@ -143,11 +143,11 @@ public:
XThrowIfError(ExtAudioFileGetProperty(mExtAF, kExtAudioFileProperty_FileDataFormat, &size, &mFileDataFormat), "Couldn't get file's data format");
return mFileDataFormat;
}
-
+
const CAAudioChannelLayout & GetFileChannelLayout() {
return FetchChannelLayout(mFileChannelLayout, kExtAudioFileProperty_FileChannelLayout);
}
-
+
void SetFileChannelLayout(const CAAudioChannelLayout &layout) {
XThrowIfError(ExtAudioFileSetProperty(mExtAF, kExtAudioFileProperty_FileChannelLayout, layout.Size(), &layout.Layout()), "Couldn't set file's channel layout");
mFileChannelLayout = layout;
@@ -158,21 +158,21 @@ public:
XThrowIfError(ExtAudioFileGetProperty(mExtAF, kExtAudioFileProperty_ClientDataFormat, &size, &mClientDataFormat), "Couldn't get client data format");
return mClientDataFormat;
}
-
+
const CAAudioChannelLayout & GetClientChannelLayout() {
return FetchChannelLayout(mClientChannelLayout, kExtAudioFileProperty_ClientChannelLayout);
}
-
+
void SetClientFormat(const CAStreamBasicDescription &dataFormat, const CAAudioChannelLayout *layout=NULL) {
XThrowIfError(ExtAudioFileSetProperty(mExtAF, kExtAudioFileProperty_ClientDataFormat, sizeof(dataFormat), &dataFormat), "Couldn't set client format");
if (layout)
SetClientChannelLayout(*layout);
}
-
+
void SetClientChannelLayout(const CAAudioChannelLayout &layout) {
XThrowIfError(ExtAudioFileSetProperty(mExtAF, kExtAudioFileProperty_ClientChannelLayout, layout.Size(), &layout.Layout()), "Couldn't set client channel layout");
}
-
+
AudioConverterRef GetConverter() const {
UInt32 size = sizeof(AudioConverterRef);
AudioConverterRef converter;
@@ -192,28 +192,28 @@ public:
}
return err;
}
-
+
SInt64 GetNumberFrames() {
SInt64 length;
UInt32 size = sizeof(SInt64);
XThrowIfError(ExtAudioFileGetProperty(mExtAF, kExtAudioFileProperty_FileLengthFrames, &size, &length), "Couldn't get file's length");
return length;
}
-
+
void SetNumberFrames(SInt64 length) {
XThrowIfError(ExtAudioFileSetProperty(mExtAF, kExtAudioFileProperty_FileLengthFrames, sizeof(SInt64), &length), "Couldn't set file's length");
}
-
+
void Seek(SInt64 pos) {
XThrowIfError(ExtAudioFileSeek(mExtAF, pos), "Couldn't seek in audio file");
}
-
+
SInt64 Tell() {
SInt64 pos;
XThrowIfError(ExtAudioFileTell(mExtAF, &pos), "Couldn't get file's mark");
return pos;
}
-
+
void Read(UInt32 &ioFrames, AudioBufferList *ioData) {
XThrowIfError(ExtAudioFileRead(mExtAF, &ioFrames, ioData), "Couldn't read audio file");
}
@@ -261,12 +261,12 @@ private:
// - Open
// - PrepareNew followed by Create
// - Wrap
-
+
void Open(const FSRef &fsref);
// open an existing file
void CreateNew(const FSRef &inParentDir, CFStringRef inFileName, AudioFileTypeID inFileType, const AudioStreamBasicDescription &inStreamDesc, const AudioChannelLayout *inChannelLayout=NULL);
-
+
void Wrap(AudioFileID fileID, bool forWriting);
// use this to wrap an AudioFileID opened externally
@@ -274,7 +274,7 @@ private:
void Close();
// In case you want to close the file before the destructor executes
-
+
// --- Data formats ---
// Allow specifying the file's channel layout. Must be called before SetClientFormat.
@@ -282,14 +282,14 @@ private:
// the channel layout). When reading, the specified layout overrides the one read from the file,
// if any.
void SetFileChannelLayout(const CAAudioChannelLayout &layout);
-
+
// This specifies the data format which the client will use for reading/writing the file,
// which may be different from the file's format. An AudioConverter is created if necessary.
// The client format must be linear PCM.
void SetClientFormat(const CAStreamBasicDescription &dataFormat, const CAAudioChannelLayout *layout=NULL);
void SetClientDataFormat(const CAStreamBasicDescription &dataFormat) { SetClientFormat(dataFormat, NULL); }
void SetClientChannelLayout(const CAAudioChannelLayout &layout) { SetClientFormat(mClientDataFormat, &layout); }
-
+
// Wrapping the underlying converter, if there is one
OSStatus SetConverterProperty(AudioConverterPropertyID inPropertyID,
UInt32 inPropertyDataSize,
@@ -298,7 +298,7 @@ private:
void SetConverterConfig(CFArrayRef config) {
SetConverterProperty(kAudioConverterPropertySettings, sizeof(config), &config); }
CFArrayRef GetConverterConfig();
-
+
// --- I/O ---
// All I/O is sequential, but you can seek to an arbitrary position when reading.
// SeekToPacket and TellPacket's packet numbers are in the file's data format, not the client's.
@@ -310,7 +310,7 @@ private:
// These can fail for files without a constant mFramesPerPacket
void Seek(SInt64 frameNumber);
SInt64 Tell() const; // frameNumber
-
+
// --- Accessors ---
// note: client parameters only valid if SetClientFormat has been called
AudioFileID GetAudioFileID() const { return mAudioFile; }
@@ -331,27 +331,27 @@ private:
SInt64 GetNumberFrames() const;
// will be 0 if the file's frames/packet is 0 (variable)
void SetNumberFrames(SInt64 length); // should only be set on a PCM file
-
+
// --- Tunable performance parameters ---
void SetUseCache(bool b) { mUseCache = b; }
void SetIOBufferSizeBytes(UInt32 bufferSizeBytes) { mIOBufferSizeBytes = bufferSizeBytes; }
UInt32 GetIOBufferSizeBytes() { return mIOBufferSizeBytes; }
void * GetIOBuffer() { return mIOBufferList.mBuffers[0].mData; }
void SetIOBuffer(void *buf);
-
+
// -- Profiling ---
#if CAAUDIOFILE_PROFILE
void EnableProfiling(bool b) { mProfiling = b; }
UInt64 TicksInConverter() const { return (mTicksInConverter > 0) ? (mTicksInConverter - mTicksInReadInConverter) : 0; }
UInt64 TicksInIO() const { return mTicksInIO; }
#endif
-
+
// _______________________________________________________________________________________
private:
SInt64 FileDataOffset();
void SeekToPacket(SInt64 packetNumber);
SInt64 TellPacket() const { return mPacketMark; } // will be imprecise if SeekToFrame was called
-
+
void SetConverterChannelLayout(bool output, const CAAudioChannelLayout &layout);
void WritePacketsFromCallback(
AudioConverterComplexInputDataProc inInputDataProc,
@@ -372,13 +372,13 @@ private:
UInt32* ioNumberDataPackets,
AudioBufferList* ioData,
AudioStreamPacketDescription** outDataPacketDescription,
- void* inUserData);
+ void* inUserData);
static OSStatus WriteInputProc( AudioConverterRef inAudioConverter,
UInt32* ioNumberDataPackets,
AudioBufferList* ioData,
AudioStreamPacketDescription** outDataPacketDescription,
- void* inUserData);
+ void* inUserData);
// _______________________________________________________________________________________
private:
@@ -389,7 +389,7 @@ private:
bool mUseCache;
bool mFinishingEncoding;
enum { kClosed, kReading, kPreparingToCreate, kPreparingToWrite, kWriting } mMode;
-
+
// SInt64 mNumberPackets; // in file's format
SInt64 mFileDataOffset;
SInt64 mPacketMark; // in file's format
@@ -398,7 +398,7 @@ private:
// lie at frame 2112 of a decoded AAC file
SInt32 mFrame0Offset;
UInt32 mFramesToSkipFollowingSeek;
-
+
// buffers
UInt32 mIOBufferSizeBytes;
UInt32 mIOBufferSizePackets;
@@ -406,7 +406,7 @@ private:
bool mClientOwnsIOBuffer;
AudioStreamPacketDescription *mPacketDescs;
UInt32 mNumPacketDescs;
-
+
// formats/conversion
AudioConverterRef mConverter;
CAStreamBasicDescription mFileDataFormat;
@@ -415,18 +415,18 @@ private:
CAAudioChannelLayout mClientChannelLayout;
UInt32 mFileMaxPacketSize;
UInt32 mClientMaxPacketSize;
-
+
// cookie
Byte * mMagicCookie;
UInt32 mMagicCookieSize;
-
+
// for ReadPackets
UInt32 mMaxPacketsToRead;
-
+
// for WritePackets
UInt32 mWritePackets;
CABufferList * mWriteBufferList;
-
+
#if CAAUDIOFILE_PROFILE
// performance
bool mProfiling;
diff --git a/libs/appleutility/CAAudioUnit.cpp b/libs/appleutility/CAAudioUnit.cpp
index 853cfc124c..f0b0890c51 100644
--- a/libs/appleutility/CAAudioUnit.cpp
+++ b/libs/appleutility/CAAudioUnit.cpp
@@ -55,7 +55,7 @@
struct StackAUChannelInfo {
StackAUChannelInfo (UInt32 inSize) : mChanInfo ((AUChannelInfo*)malloc (inSize)) {}
~StackAUChannelInfo() { free (mChanInfo); }
-
+
AUChannelInfo* mChanInfo;
};
@@ -77,9 +77,9 @@ public:
{
Init();
}
-
+
~AUState();
-
+
AudioUnit mUnit;
AUNode mNode;
@@ -89,7 +89,7 @@ public:
if (mGetParamProc != NULL) {
return reinterpret_cast<AudioUnitGetParameterProc>(mGetParamProc) (mConnInstanceStorage,
inID, scope, element, &outValue);
- }
+ }
return AudioUnitGetParameter(mUnit, inID, scope, element, &outValue);
}
@@ -99,10 +99,10 @@ public:
if (mSetParamProc != NULL) {
return reinterpret_cast<AudioUnitSetParameterProc>(mSetParamProc) (mConnInstanceStorage,
inID, scope, element, value, bufferOffsetFrames);
- }
+ }
return AudioUnitSetParameter(mUnit, inID, scope, element, value, bufferOffsetFrames);
}
-
+
OSStatus Render (AudioUnitRenderActionFlags * ioActionFlags,
const AudioTimeStamp * inTimeStamp,
UInt32 inOutputBusNumber,
@@ -112,10 +112,10 @@ public:
if (mRenderProc != NULL) {
return reinterpret_cast<AudioUnitRenderProc>(mRenderProc) (mConnInstanceStorage,
ioActionFlags, inTimeStamp, inOutputBusNumber, inNumberFrames, ioData);
- }
+ }
return AudioUnitRender(mUnit, ioActionFlags, inTimeStamp, inOutputBusNumber, inNumberFrames, ioData);
}
-
+
OSStatus MIDIEvent (UInt32 inStatus,
UInt32 inData1,
UInt32 inData2,
@@ -177,13 +177,13 @@ private:
kAudioUnitScope_Global, kMusicDeviceMIDIEventSelect,
&mMIDIEventProc, &size) != noErr)
mMIDIEventProc = NULL;
-
+
if (mRenderProc || mGetParamProc || mSetParamProc || mMIDIEventProc)
mConnInstanceStorage = GetComponentInstanceStorage(mUnit);
else
mConnInstanceStorage = NULL;
}
-
+
ProcPtr mRenderProc, mGetParamProc, mSetParamProc, mMIDIEventProc;
void * mConnInstanceStorage;
@@ -193,9 +193,9 @@ private:
AUState () {}
AUState (const AUState& other) : CAReferenceCounted (other) {}
AUState& operator= (const AUState&) { return *this; }
-};
-
-
+};
+
+
CAAudioUnit::AUState::~AUState ()
{
if (mUnit && (mNode == 0)) {
@@ -246,13 +246,13 @@ CAAudioUnit& CAAudioUnit::operator= (const CAAudioUnit &a)
if (mDataPtr != a.mDataPtr) {
if (mDataPtr)
mDataPtr->release();
-
+
if ((mDataPtr = a.mDataPtr) != NULL)
mDataPtr->retain();
-
+
mComp = a.mComp;
}
-
+
return *this;
}
@@ -270,13 +270,13 @@ bool CAAudioUnit::operator== (const AudioUnit& y) const
return mDataPtr->mUnit == y;
}
-#pragma mark __State Management
+#pragma mark __State Management
bool CAAudioUnit::IsValid () const
{
return mDataPtr ? mDataPtr->mUnit != 0 : false;
}
-
+
AudioUnit CAAudioUnit::AU() const
{
return mDataPtr ? mDataPtr->mUnit : 0;
@@ -288,10 +288,10 @@ AUNode CAAudioUnit::GetAUNode () const
}
#pragma mark __Format Handling
-
+
bool CAAudioUnit::CanDo ( int inChannelsIn,
int inChannelsOut) const
-{
+{
// this is the default assumption of an audio effect unit
Boolean* isWritable = 0;
UInt32 dataSize = 0;
@@ -300,7 +300,7 @@ bool CAAudioUnit::CanDo ( int inChannelsIn,
kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
&dataSize, isWritable); //don't care if this is writable
-
+
// if this property is NOT implemented an FX unit
// is expected to deal with same channel valance in and out
if (result)
@@ -317,14 +317,14 @@ bool CAAudioUnit::CanDo ( int inChannelsIn,
return false;
}
}
-
+
StackAUChannelInfo info (dataSize);
-
+
result = GetProperty (kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
info.mChanInfo, &dataSize);
if (result) { return false; }
-
+
return ValidateChannelPair (inChannelsIn, inChannelsOut, info.mChanInfo, (dataSize / sizeof (AUChannelInfo)));
}
@@ -338,10 +338,10 @@ int CAAudioUnit::GetChannelInfo (AUChannelInfo** chaninfo, UInt32& cnt)
kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
&dataSize, isWritable); //don't care if this is writable
-
+
// if this property is NOT implemented an FX unit
// is expected to deal with same channel valance in and out
-
+
if (result)
{
if (Comp().Desc().IsEffect())
@@ -452,7 +452,7 @@ bool CAAudioUnit::ValidateChannelPair (int inChannelsIn,
}
}
}
-
+
// special meaning on input, specific num on output
else if (info[i].inChannels < 0) {
if (info[i].outChannels == inChannelsOut)
@@ -471,7 +471,7 @@ bool CAAudioUnit::ValidateChannelPair (int inChannelsIn,
}
}
}
-
+
// special meaning on output, specific num on input
else if (info[i].outChannels < 0) {
if (info[i].inChannels == inChannelsIn)
@@ -495,7 +495,7 @@ bool CAAudioUnit::ValidateChannelPair (int inChannelsIn,
else if ((info[i].inChannels == inChannelsIn) && (info[i].outChannels == inChannelsOut)) {
return true;
}
-
+
// now check to see if a wild card on the args (inChannelsIn or inChannelsOut chans is zero) is found
// tells us to match just one side of the scopes
else if (inChannelsIn == 0) {
@@ -509,7 +509,7 @@ bool CAAudioUnit::ValidateChannelPair (int inChannelsIn,
}
}
}
-
+
return false;
}
@@ -553,14 +553,14 @@ bool CAAudioUnit::CanDo (const CAAUChanHelper &inputs,
// first check our state
// huh!
if (inputs.mNumEls == 0 && outputs.mNumEls == 0) return false;
-
+
UInt32 elCount;
if (GetElementCount (kAudioUnitScope_Input, elCount)) { return false; }
if (elCount != inputs.mNumEls) return false;
if (GetElementCount (kAudioUnitScope_Output, elCount)) { return false; }
if (elCount != outputs.mNumEls) return false;
-
+
// (1) special cases (effects and sources (generators and instruments) only)
UInt32 dataSize = 0;
if (GetPropertyInfo (kAudioUnitProperty_SupportedNumChannels,
@@ -574,7 +574,7 @@ bool CAAudioUnit::CanDo (const CAAUChanHelper &inputs,
if (numChan != outputs.mChans[out]) return false;
return true;
}
-
+
// in this case, all the channels have to match the current config
if (Comp().Desc().IsGenerator() || Comp().Desc().IsMusicDevice()) {
for (unsigned int in = 0; in < inputs.mNumEls; ++in) {
@@ -589,22 +589,22 @@ bool CAAudioUnit::CanDo (const CAAUChanHelper &inputs,
}
return true;
}
-
+
// if we get here we can't determine anything about channel capabilities
return false;
}
StackAUChannelInfo info (dataSize);
-
+
if (GetProperty (kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
info.mChanInfo, &dataSize) != noErr)
{
return false;
}
-
+
int numInfo = dataSize / sizeof(AUChannelInfo);
-
+
// (2) Test for dynamic capability (or no elements on that scope)
SInt32 dynInChans = 0;
if (ValidateDynamicScope (kAudioUnitScope_Input, dynInChans, info.mChanInfo, numInfo)) {
@@ -655,7 +655,7 @@ bool CAAudioUnit::CanDo (const CAAUChanHelper &inputs,
}
}
}
-
+
return true;
}
@@ -669,7 +669,7 @@ bool CAAudioUnit::SupportsNumChannels () const
kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
&dataSize, isWritable); //don't care if this is writable
-
+
// if this property is NOT implemented an FX unit
// is expected to deal with same channel valance in and out
if (result) {
@@ -702,7 +702,7 @@ bool CAAudioUnit::GetChannelLayouts (AudioUnitScope inScope,
}
if (result) return false;
-
+
bool canDo = false;
// OK lets get our channel layouts and see if the one we want is present
AudioChannelLayoutTag* info = (AudioChannelLayoutTag*)malloc (dataSize);
@@ -711,7 +711,7 @@ bool CAAudioUnit::GetChannelLayouts (AudioUnitScope inScope,
inScope, inEl,
info, &dataSize);
if (result) goto home;
-
+
outChannelVector.erase (outChannelVector.begin(), outChannelVector.end());
for (unsigned int i = 0; i < (dataSize / sizeof (AudioChannelLayoutTag)); ++i)
outChannelVector.push_back (info[i]);
@@ -739,14 +739,14 @@ OSStatus CAAudioUnit::GetChannelLayout (AudioUnitScope inScope,
OSStatus result = AudioUnitGetPropertyInfo (AU(), kAudioUnitProperty_AudioChannelLayout,
inScope, inEl, &size, NULL);
if (result) return result;
-
+
AudioChannelLayout *layout = (AudioChannelLayout*)malloc (size);
require_noerr (result = AudioUnitGetProperty (AU(), kAudioUnitProperty_AudioChannelLayout,
inScope, inEl, layout, &size), home);
outLayout = CAAudioChannelLayout (layout);
-
+
home:
free (layout);
return result;
@@ -827,7 +827,7 @@ OSStatus CAAudioUnit::SetSampleRate (AudioUnitScope inScope,
OSStatus CAAudioUnit::SetSampleRate (Float64 inSampleRate)
{
OSStatus result;
-
+
UInt32 elCount;
require_noerr (result = GetElementCount(kAudioUnitScope_Input, elCount), home);
if (elCount) {
@@ -842,7 +842,7 @@ OSStatus CAAudioUnit::SetSampleRate (Float64 inSampleRate)
require_noerr (result = SetSampleRate (kAudioUnitScope_Output, i, inSampleRate), home);
}
}
-
+
home:
return result;
}
@@ -879,7 +879,7 @@ OSStatus CAAudioUnit::IsElementCountWritable (AudioUnitScope inScope, bool &out
if (result)
return result;
outWritable = isWritable ? true : false;
- return noErr;
+ return noErr;
}
OSStatus CAAudioUnit::GetElementCount (AudioUnitScope inScope, UInt32 &outCount) const
@@ -902,12 +902,12 @@ bool CAAudioUnit::HasDynamicScope (AudioUnitScope inScope, SInt32 &outTotalNum
OSStatus result = GetPropertyInfo (kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
&dataSize, isWritable); //don't care if this is writable
-
+
// AU has to explicitly tell us about this.
if (result) return false;
StackAUChannelInfo info (dataSize);
-
+
result = GetProperty (kAudioUnitProperty_SupportedNumChannels,
kAudioUnitScope_Global, 0,
info.mChanInfo, &dataSize);
@@ -945,36 +945,36 @@ bool CAAudioUnit::ValidateDynamicScope (AudioUnitScope inScope,
outTotalNumChannels = -1;
return true;
}
-
+
// ok lets now test our special case....
if (inScope == kAudioUnitScope_Input) {
// isn't dynamic on this side at least
if (info[i].inChannels >= 0)
continue;
-
+
if (info[i].inChannels < -2) {
outTotalNumChannels = abs (info[i].inChannels);
return true;
}
}
-
+
else if (inScope == kAudioUnitScope_Output) {
// isn't dynamic on this side at least
if (info[i].outChannels >= 0)
continue;
-
+
if (info[i].outChannels < -2) {
outTotalNumChannels = abs (info[i].outChannels);
return true;
}
}
-
+
else {
break; // wrong scope was specified
}
}
-
- return false;
+
+ return false;
}
OSStatus CAAudioUnit::ConfigureDynamicScope (AudioUnitScope inScope,
@@ -986,7 +986,7 @@ OSStatus CAAudioUnit::ConfigureDynamicScope (AudioUnitScope inScope,
bool isDyamic = HasDynamicScope (inScope, numChannels);
if (isDyamic == false)
return kAudioUnitErr_InvalidProperty;
-
+
//lets to a sanity check...
// if numChannels == -1, then it can do "any"...
if (numChannels > 0) {
@@ -996,11 +996,11 @@ OSStatus CAAudioUnit::ConfigureDynamicScope (AudioUnitScope inScope,
if (count > numChannels)
return kAudioUnitErr_InvalidPropertyValue;
}
-
+
OSStatus result = SetElementCount (inScope, inNumElements);
if (result)
return result;
-
+
CAStreamBasicDescription desc;
desc.mSampleRate = inSampleRate;
for (unsigned int i = 0; i < inNumElements; ++i) {
@@ -1034,7 +1034,7 @@ bool CAAudioUnit::GetBypass () const
}
OSStatus CAAudioUnit::SetBypass (bool inBypass) const
-{
+{
UInt32 bypass = inBypass ? 1 : 0;
return AudioUnitSetProperty (AU(), kAudioUnitProperty_BypassEffect,
kAudioUnitScope_Global, 0,
@@ -1085,7 +1085,7 @@ OSStatus CAAudioUnit::GetPresentPreset (AUPreset &outData) const
}
return result;
}
-
+
OSStatus CAAudioUnit::SetPresentPreset (AUPreset &inData)
{
OSStatus result = AudioUnitSetProperty (AU(), kAudioUnitProperty_PresentPreset,
@@ -1184,18 +1184,18 @@ OSStatus CAAudioUnit::Preroll (UInt32 inFrameSize)
CAStreamBasicDescription desc;
OSStatus result = GetFormat (kAudioUnitScope_Input, 0, desc);
bool hasInput = false;
- //we have input
+ //we have input
if (result == noErr)
{
sRenderCallback.inputProc = PrerollRenderProc;
sRenderCallback.inputProcRefCon = 0;
-
+
result = SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
0, &sRenderCallback, sizeof(sRenderCallback));
if (result) return result;
hasInput = true;
}
-
+
AudioUnitRenderActionFlags flags = 0;
AudioTimeStamp time;
memset (&time, 0, sizeof(time));
@@ -1206,7 +1206,7 @@ OSStatus CAAudioUnit::Preroll (UInt32 inFrameSize)
{
AUOutputBL list (outputFormat, inFrameSize);
list.Prepare ();
-
+
require_noerr (result = Render (&flags, &time, 0, inFrameSize, list.ABL()), home);
require_noerr (result = GlobalReset(), home);
}
@@ -1216,7 +1216,7 @@ home:
// remove our installed callback
sRenderCallback.inputProc = 0;
sRenderCallback.inputProcRefCon = 0;
-
+
SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
0, &sRenderCallback, sizeof(sRenderCallback));
}
@@ -1262,7 +1262,7 @@ CAAUChanHelper& CAAUChanHelper::operator= (const CAAUChanHelper &c)
mChans = mStaticChans;
}
memcpy (mChans, c.mChans, c.mNumEls * sizeof(int));
-
+
return *this;
}
diff --git a/libs/appleutility/CAAudioUnit.h b/libs/appleutility/CAAudioUnit.h
index e5927af1fc..7be48464e7 100644
--- a/libs/appleutility/CAAudioUnit.h
+++ b/libs/appleutility/CAAudioUnit.h
@@ -94,26 +94,26 @@ public:
~CAAudioUnit ();
-
+
CAAudioUnit& operator= (const CAAudioUnit& y);
bool operator== (const CAAudioUnit& y) const;
bool operator== (const AudioUnit& y) const;
-#pragma mark __State Management
+#pragma mark __State Management
bool IsValid () const;
-
+
AudioUnit AU() const;
operator AudioUnit () const { return AU(); }
const CAComponent& Comp() const { return mComp; }
-
+
bool FromAUGraph () const { return GetAUNode() != 0 || GetAUNode() != -1; }
-
+
AUNode GetAUNode () const;
operator AUNode () const { return GetAUNode(); }
-
+
#pragma mark __API Wrapper
OSStatus Initialize() const { return AudioUnitInitialize(AU()); }
OSStatus Uninitialize() const { return AudioUnitUninitialize(AU()); }
@@ -134,7 +134,7 @@ public:
}
OSStatus SetParameter(AudioUnitParameterID inID, AudioUnitScope scope, AudioUnitElement element,
Float32 value, UInt32 bufferOffsetFrames=0);
-
+
OSStatus GetParameter(AudioUnitParameterID inID, AudioUnitScope scope, AudioUnitElement element,
Float32 &outValue) const;
@@ -143,7 +143,7 @@ public:
UInt32 inOutputBusNumber,
UInt32 inNumberFrames,
AudioBufferList * ioData);
-
+
OSStatus Reset (AudioUnitScope scope, AudioUnitElement element)
{
return AudioUnitReset (AU(), scope, element);
@@ -159,19 +159,19 @@ public:
{
return AudioUnitAddRenderNotify (AU(), inProc, inProcRefCon);
}
-
+
OSStatus RemoveRenderNotify (AURenderCallback inProc, void *inProcRefCon)
{
return AudioUnitRemoveRenderNotify (AU(), inProc, inProcRefCon);
}
-
-// Fast dispatch support for MIDI Effects or Music Devices
+
+// Fast dispatch support for MIDI Effects or Music Devices
OSStatus MIDIEvent (UInt32 inStatus,
UInt32 inData1,
UInt32 inData2,
UInt32 inOffsetSampleFrame);
-
+
// uses the default VoiceForGroup value - this is the normal case
OSStatus StartNote (MusicDeviceGroupID inGroupID,
NoteInstanceID * outNoteInstanceID,
@@ -203,29 +203,29 @@ public:
{
return CanDo (inChannelsInOut, inChannelsInOut);
}
-
+
bool CanDo ( int inChannelsIn,
int inChannelsOut) const;
-
+
// This version does a more thorough test for ANY AU with ANY ins/outs
// you pass in the channel helper (for the current element count on that scope)
-
+
bool CanDo ( const CAAUChanHelper &input,
const CAAUChanHelper &output) const;
-
+
bool SupportsNumChannels () const;
-
+
bool HasChannelLayouts (AudioUnitScope inScope,
AudioUnitElement inEl) const;
-
+
int GetChannelInfo (AUChannelInfo** chaninfo, UInt32& cnt);
bool GetChannelLayouts (AudioUnitScope inScope,
AudioUnitElement inEl,
ChannelTagVector &outChannelVector) const;
-
+
OSStatus GetChannelLayout (AudioUnitScope inScope,
AudioUnitElement inEl,
- CAAudioChannelLayout &outLayout) const;
+ CAAudioChannelLayout &outLayout) const;
OSStatus SetChannelLayout (AudioUnitScope inScope,
AudioUnitElement inEl,
@@ -235,10 +235,10 @@ public:
AudioUnitElement inEl,
AudioChannelLayout &inLayout,
UInt32 inSize);
-
+
OSStatus ClearChannelLayout (AudioUnitScope inScope,
AudioUnitElement inEl);
-
+
OSStatus GetFormat (AudioUnitScope inScope,
AudioUnitElement inEl,
AudioStreamBasicDescription &outFormat) const;
@@ -257,7 +257,7 @@ public:
// this sets the sample rate on all in/out buses of the AU
OSStatus SetSampleRate (Float64 inSampleRate);
-
+
OSStatus NumberChannels (AudioUnitScope inScope,
AudioUnitElement inEl,
UInt32 &outChans) const;
@@ -278,7 +278,7 @@ public:
OSStatus GetElementCount (AudioUnitScope inScope, UInt32 &outCount) const;
OSStatus SetElementCount (AudioUnitScope inScope, UInt32 inCount);
-
+
// value of -1 for outTotalNumChannels indicates no restriction on num channels
// for ex. the Matrix Mixer satisfies this (its in/out element count is writable, and can be set to
// any number of channels.
@@ -287,19 +287,19 @@ public:
{
return HasDynamicScope (kAudioUnitScope_Input, outTotalNumChannels);
}
-
+
bool HasDynamicOutputs (SInt32 &outTotalNumChannels) const
{
return HasDynamicScope (kAudioUnitScope_Output, outTotalNumChannels);
}
-
+
// here, if the in (or out) elements are dynamic, then you supply the number of elements
// you want on in (or out) scope, and the number of channels on each consecutive element
OSStatus ConfigureDynamicInput (UInt32 inNumElements, UInt32 *inChannelsPerElement, Float64 inSampleRate)
{
return ConfigureDynamicScope (kAudioUnitScope_Input, inNumElements, inChannelsPerElement, inSampleRate);
}
-
+
OSStatus ConfigureDynamicOutput (UInt32 inNumElements, UInt32 *inChannelsPerElement, Float64 inSampleRate)
{
return ConfigureDynamicScope (kAudioUnitScope_Output, inNumElements, inChannelsPerElement, inSampleRate);
@@ -310,31 +310,31 @@ public:
bool GetBypass () const;
OSStatus SetBypass (bool inBypass) const;
-
+
Float64 Latency () const;
-
+
// these calls just deal with the global preset state
// you could rescope them to deal with presets on the part scope
OSStatus GetAUPreset (CFPropertyListRef &outData) const;
OSStatus SetAUPreset (CFPropertyListRef &inData);
-
+
OSStatus GetPresentPreset (AUPreset &outData) const;
-
+
OSStatus SetPresentPreset (AUPreset &inData);
-
+
bool HasCustomView () const;
-
-#pragma mark __Print
+
+#pragma mark __Print
void Print () const { Print (stdout); }
void Print (FILE* file) const;
-
+
private:
CAComponent mComp;
-
+
class AUState;
AUState* mDataPtr;
-
+
// this can throw - so wrap this up in a static that returns a result code...
CAAudioUnit (const CAComponent& inComp);
@@ -347,7 +347,7 @@ private:
int inChannelsOut,
const AUChannelInfo * info,
UInt32 numChanInfo) const;
-
+
bool ValidateDynamicScope (AudioUnitScope inScope,
SInt32 &outTotalNumChannels,
const AUChannelInfo * info,
@@ -356,7 +356,7 @@ private:
bool checkOutput,
const AUChannelInfo *info,
UInt32 numInfo) const;
-
+
};
class CAAUChanHelper {
@@ -368,14 +368,14 @@ public:
}
CAAUChanHelper(const CAAudioUnit &inAU, AudioUnitScope inScope);
CAAUChanHelper (const CAAUChanHelper &c) :mChans(mStaticChans), mNumEls(0), mDidAllocate(false) { *this = c; }
-
+
~CAAUChanHelper();
CAAUChanHelper& operator= (const CAAUChanHelper &c);
UInt32 * mChans;
UInt32 mNumEls;
-
+
private:
UInt32 mStaticChans[8];
bool mDidAllocate;
diff --git a/libs/appleutility/CABufferList.cpp b/libs/appleutility/CABufferList.cpp
index 47fe524f6f..581f1adda7 100644
--- a/libs/appleutility/CABufferList.cpp
+++ b/libs/appleutility/CABufferList.cpp
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CABufferList.cpp
-
+
=============================================================================*/
#include "CABufferList.h"
@@ -50,7 +50,7 @@
void CABufferList::AllocateBuffers(UInt32 nBytes)
{
if (nBytes <= GetNumBytes()) return;
-
+
if (mNumberBuffers > 1)
// align successive buffers for Altivec and to take alternating
// cache line hits by spacing them by odd multiples of 16
@@ -58,7 +58,7 @@ void CABufferList::AllocateBuffers(UInt32 nBytes)
UInt32 memorySize = nBytes * mNumberBuffers;
Byte *newMemory = new Byte[memorySize], *p = newMemory;
memset(newMemory, 0, memorySize); // get page faults now, not later
-
+
AudioBuffer *buf = mBuffers;
for (UInt32 i = mNumberBuffers; i--; ++buf) {
if (buf->mData != NULL && buf->mDataByteSize > 0)
@@ -83,7 +83,7 @@ void CABufferList::AllocateBuffersAndCopyFrom(UInt32 nBytes, CABufferList *inSr
}
inSetPtrList->VerifyNotTrashingOwnedBuffer();
UInt32 fromByteSize = inSrcList->GetNumBytes();
-
+
if (mNumberBuffers > 1)
// align successive buffers for Altivec and to take alternating
// cache line hits by spacing them by odd multiples of 16
@@ -91,7 +91,7 @@ void CABufferList::AllocateBuffersAndCopyFrom(UInt32 nBytes, CABufferList *inSr
UInt32 memorySize = nBytes * mNumberBuffers;
Byte *newMemory = new Byte[memorySize], *p = newMemory;
memset(newMemory, 0, memorySize); // make buffer "hot"
-
+
AudioBuffer *buf = mBuffers;
AudioBuffer *ptrBuf = inSetPtrList->mBuffers;
AudioBuffer *srcBuf = inSrcList->mBuffers;
diff --git a/libs/appleutility/CABufferList.h b/libs/appleutility/CABufferList.h
index 8f69de9413..fc94769458 100644
--- a/libs/appleutility/CABufferList.h
+++ b/libs/appleutility/CABufferList.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CABufferList.h
-
+
=============================================================================*/
#ifndef __CABufferList_h__
@@ -59,7 +59,7 @@ extern "C" void CAShowAudioBufferList(const AudioBufferList *abl, int framesToPr
This class is designed for use in non-simplistic cases. For AudioUnits, AUBufferList
is preferred.
-
+
CABufferList can be used in one of two ways:
- as mutable pointers into non-owned memory
- as an immutable array of buffers (owns its own memory).
@@ -99,22 +99,22 @@ public:
if (mBufferMemory)
delete[] mBufferMemory;
}
-
+
const char * Name() { return mName; }
-
+
const AudioBufferList & GetBufferList() const { return *(AudioBufferList *)&mNumberBuffers; }
-
+
AudioBufferList & GetModifiableBufferList()
{
VerifyNotTrashingOwnedBuffer();
return _GetBufferList();
}
-
+
UInt32 GetNumBytes() const
{
return mBuffers[0].mDataByteSize;
}
-
+
void SetBytes(UInt32 nBytes, void *data)
{
VerifyNotTrashingOwnedBuffer();
@@ -122,7 +122,7 @@ public:
mBuffers[0].mDataByteSize = nBytes;
mBuffers[0].mData = data;
}
-
+
void CopyAllFrom(CABufferList *srcbl, CABufferList *ptrbl)
// copies bytes from srcbl
// make ptrbl reflect the length copied
@@ -144,7 +144,7 @@ public:
if (srcbl != ptrbl)
srcbl->BytesConsumed(nBytes);
}
-
+
void AppendFrom(CABufferList *blp, UInt32 nBytes)
{
VerifyNotTrashingOwnedBuffer();
@@ -156,7 +156,7 @@ public:
}
blp->BytesConsumed(nBytes);
}
-
+
void PadWithZeroes(UInt32 desiredBufferSize)
// for cases where an algorithm (e.g. SRC) requires some
// padding to create silence following end-of-file
@@ -169,7 +169,7 @@ public:
buf->mDataByteSize = desiredBufferSize;
}
}
-
+
void SetToZeroes(UInt32 nBytes)
{
VerifyNotTrashingOwnedBuffer();
@@ -179,23 +179,23 @@ public:
buf->mDataByteSize = nBytes;
}
}
-
+
void Reset()
{
DeallocateBuffers();
}
-
+
Boolean SameDataAs(const CABufferList* anotherBufferList)
{
// check to see if two buffer lists point to the same memory.
if (mNumberBuffers != anotherBufferList->mNumberBuffers) return false;
-
+
for (UInt32 i = 0; i < mNumberBuffers; ++i) {
if (mBuffers[i].mData != anotherBufferList->mBuffers[i].mData) return false;
}
return true;
}
-
+
void BytesConsumed(UInt32 nBytes)
// advance buffer pointers, decrease buffer sizes
{
@@ -207,18 +207,18 @@ public:
buf->mDataByteSize -= nBytes;
}
}
-
+
void SetFrom(const AudioBufferList *abl)
{
VerifyNotTrashingOwnedBuffer();
memcpy(&_GetBufferList(), abl, (char *)&abl->mBuffers[abl->mNumberBuffers] - (char *)abl);
}
-
+
void SetFrom(const CABufferList *blp)
{
SetFrom(&blp->GetBufferList());
}
-
+
void SetFrom(const AudioBufferList *abl, UInt32 nBytes)
{
VerifyNotTrashingOwnedBuffer();
@@ -230,23 +230,23 @@ public:
mybuf->mData = srcbuf->mData;
}
}
-
+
void SetFrom(const CABufferList *blp, UInt32 nBytes)
{
SetFrom(&blp->GetBufferList(), nBytes);
}
-
+
AudioBufferList * ToAudioBufferList(AudioBufferList *abl) const
{
memcpy(abl, &GetBufferList(), (char *)&abl->mBuffers[mNumberBuffers] - (char *)abl);
return abl;
}
-
+
void AllocateBuffers(UInt32 nBytes);
void AllocateBuffersAndCopyFrom(UInt32 nBytes, CABufferList *inCopyFromList, CABufferList *inSetPtrList);
-
+
void DeallocateBuffers();
-
+
void UseExternalBuffer(Byte *ptr, UInt32 nBytes);
void AdvanceBufferPointers(UInt32 nBytes)
@@ -261,7 +261,7 @@ public:
buf->mDataByteSize -= nBytes;
}
}
-
+
void SetNumBytes(UInt32 nBytes)
{
VerifyNotTrashingOwnedBuffer();
diff --git a/libs/appleutility/CACFDictionary.cpp b/libs/appleutility/CACFDictionary.cpp
index c209b5fc36..ed983a828f 100644
--- a/libs/appleutility/CACFDictionary.cpp
+++ b/libs/appleutility/CACFDictionary.cpp
@@ -74,7 +74,7 @@ void CACFDictionary::GetKeys (const void **keys) const
bool CACFDictionary::GetBool(const CFStringRef inKey, bool& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -91,14 +91,14 @@ bool CACFDictionary::GetBool(const CFStringRef inKey, bool& outValue) const
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetSInt32(const CFStringRef inKey, SInt32& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -108,14 +108,14 @@ bool CACFDictionary::GetSInt32(const CFStringRef inKey, SInt32& outValue) const
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetUInt32(const CFStringRef inKey, UInt32& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -125,14 +125,14 @@ bool CACFDictionary::GetUInt32(const CFStringRef inKey, UInt32& outValue) const
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetSInt64(const CFStringRef inKey, SInt64& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -142,14 +142,14 @@ bool CACFDictionary::GetSInt64(const CFStringRef inKey, SInt64& outValue) const
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetUInt64(const CFStringRef inKey, UInt64& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -159,14 +159,14 @@ bool CACFDictionary::GetUInt64(const CFStringRef inKey, UInt64& outValue) const
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetFloat32(const CFStringRef inKey, Float32& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -176,14 +176,14 @@ bool CACFDictionary::GetFloat32(const CFStringRef inKey, Float32& outValue) cons
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetFloat64(const CFStringRef inKey, Float64& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -193,14 +193,14 @@ bool CACFDictionary::GetFloat64(const CFStringRef inKey, Float64& outValue) cons
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetString(const CFStringRef inKey, CFStringRef& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -210,14 +210,14 @@ bool CACFDictionary::GetString(const CFStringRef inKey, CFStringRef& outValue) c
theAnswer = true;
}
}
-
+
return theAnswer;
}
-
+
bool CACFDictionary::GetArray(const CFStringRef inKey, CFArrayRef& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -227,14 +227,14 @@ bool CACFDictionary::GetArray(const CFStringRef inKey, CFArrayRef& outValue) con
theAnswer = true;
}
}
-
+
return theAnswer;
}
-
+
bool CACFDictionary::GetDictionary(const CFStringRef inKey, CFDictionaryRef& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -244,14 +244,14 @@ bool CACFDictionary::GetDictionary(const CFStringRef inKey, CFDictionaryRef& out
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetData(const CFStringRef inKey, CFDataRef& outValue) const
{
bool theAnswer = false;
-
+
CFTypeRef theValue = NULL;
if(GetCFType(inKey, theValue))
{
@@ -261,27 +261,27 @@ bool CACFDictionary::GetData(const CFStringRef inKey, CFDataRef& outValue) const
theAnswer = true;
}
}
-
+
return theAnswer;
}
bool CACFDictionary::GetCFType(const CFStringRef inKey, CFTypeRef& outValue) const
{
bool theAnswer = false;
-
+
if(mCFDictionary != NULL)
{
outValue = CFDictionaryGetValue(mCFDictionary, inKey);
theAnswer = (outValue != NULL);
}
-
+
return theAnswer;
}
bool CACFDictionary::GetCFTypeWithCStringKey(const char* inKey, CFTypeRef& outValue) const
{
bool theAnswer = false;
-
+
if(mCFDictionary != NULL)
{
CACFString theKey(inKey);
@@ -290,165 +290,165 @@ bool CACFDictionary::GetCFTypeWithCStringKey(const char* inKey, CFTypeRef& outVa
theAnswer = GetCFType(theKey.GetCFString(), outValue);
}
}
-
+
return theAnswer;
}
bool CACFDictionary::AddSInt32(const CFStringRef inKey, SInt32 inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFNumber theValue(inValue);
theAnswer = AddCFType(inKey, theValue.GetCFNumber());
}
-
+
return theAnswer;
}
bool CACFDictionary::AddUInt32(const CFStringRef inKey, UInt32 inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFNumber theValue(inValue);
theAnswer = AddCFType(inKey, theValue.GetCFNumber());
}
-
+
return theAnswer;
}
bool CACFDictionary::AddSInt64(const CFStringRef inKey, SInt64 inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFNumber theValue(inValue);
theAnswer = AddCFType(inKey, theValue.GetCFNumber());
}
-
+
return theAnswer;
}
bool CACFDictionary::AddUInt64(const CFStringRef inKey, UInt64 inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFNumber theValue(inValue);
theAnswer = AddCFType(inKey, theValue.GetCFNumber());
}
-
+
return theAnswer;
}
bool CACFDictionary::AddFloat32(const CFStringRef inKey, Float32 inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFNumber theValue(inValue);
theAnswer = AddCFType(inKey, theValue.GetCFNumber());
}
-
+
return theAnswer;
}
bool CACFDictionary::AddFloat64(const CFStringRef inKey, Float64 inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFNumber theValue(inValue);
theAnswer = AddCFType(inKey, theValue.GetCFNumber());
}
-
+
return theAnswer;
}
bool CACFDictionary::AddNumber(const CFStringRef inKey, const CFNumberRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
theAnswer = AddCFType(inKey, inValue);
}
-
+
return theAnswer;
}
bool CACFDictionary::AddString(const CFStringRef inKey, const CFStringRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
theAnswer = AddCFType(inKey, inValue);
}
-
+
return theAnswer;
}
bool CACFDictionary::AddArray(const CFStringRef inKey, const CFArrayRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
theAnswer = AddCFType(inKey, inValue);
}
-
+
return theAnswer;
}
bool CACFDictionary::AddDictionary(const CFStringRef inKey, const CFDictionaryRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
theAnswer = AddCFType(inKey, inValue);
}
-
+
return theAnswer;
}
bool CACFDictionary::AddData(const CFStringRef inKey, const CFDataRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
theAnswer = AddCFType(inKey, inValue);
}
-
+
return theAnswer;
}
bool CACFDictionary::AddCFType(const CFStringRef inKey, const CFTypeRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CFDictionarySetValue(mCFDictionary, inKey, inValue);
theAnswer = true;
}
-
+
return theAnswer;
}
bool CACFDictionary::AddCFTypeWithCStringKey(const char* inKey, const CFTypeRef inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFString theKey(inKey);
@@ -457,14 +457,14 @@ bool CACFDictionary::AddCFTypeWithCStringKey(const char* inKey, const CFTypeRef
theAnswer = AddCFType(theKey.GetCFString(), inValue);
}
}
-
+
return theAnswer;
}
bool CACFDictionary::AddCString(const CFStringRef inKey, const char* inValue)
{
bool theAnswer = false;
-
+
if(mMutable && (mCFDictionary != NULL))
{
CACFString theValue(inValue);
@@ -473,6 +473,6 @@ bool CACFDictionary::AddCString(const CFStringRef inKey, const char* inValue)
theAnswer = AddCFType(inKey, theValue.GetCFString());
}
}
-
+
return theAnswer;
}
diff --git a/libs/appleutility/CACFDictionary.h b/libs/appleutility/CACFDictionary.h
index ac82ebb87c..3221436a16 100644
--- a/libs/appleutility/CACFDictionary.h
+++ b/libs/appleutility/CACFDictionary.h
@@ -68,16 +68,16 @@ public:
CACFDictionary(const CACFDictionary& inDictionary) : mCFDictionary(inDictionary.mCFDictionary), mRelease(inDictionary.mRelease), mMutable(inDictionary.mMutable) { if(mRelease && (mCFDictionary != NULL)) { CFRetain(mCFDictionary); } }
CACFDictionary& operator=(const CACFDictionary& inDictionary) { mCFDictionary = inDictionary.mCFDictionary; mRelease = inDictionary.mRelease; mMutable = inDictionary.mMutable; if(mRelease && (mCFDictionary != NULL)) { CFRetain(mCFDictionary); } return *this; }
~CACFDictionary() { if(mRelease && (mCFDictionary != NULL)) { CFRelease(mCFDictionary); } }
-
+
// Attributes
public:
bool IsValid() const { return mCFDictionary != NULL; }
bool IsMutable() const { return mMutable;}
bool CanModify() const { return mMutable && (mCFDictionary != NULL); }
-
+
bool WillRelease() const { return mRelease; }
void ShouldRelease(bool inRelease) { mRelease = inRelease; }
-
+
CFDictionaryRef GetDict() const { return mCFDictionary; }
CFDictionaryRef GetCFDictionary() const { return mCFDictionary; }
CFDictionaryRef CopyCFDictionary() const { if(mCFDictionary != NULL) { CFRetain(mCFDictionary); } return mCFDictionary; }
@@ -95,7 +95,7 @@ public:
bool HasKey(const CFStringRef inKey) const;
UInt32 Size() const;
void GetKeys(const void** keys) const;
-
+
bool GetBool(const CFStringRef inKey, bool& outValue) const;
bool GetSInt32(const CFStringRef inKey, SInt32& outValue) const;
bool GetUInt32(const CFStringRef inKey, UInt32& outValue) const;
@@ -103,12 +103,12 @@ public:
bool GetUInt64(const CFStringRef inKey, UInt64& outValue) const;
bool GetFloat32(const CFStringRef inKey, Float32& outValue) const;
bool GetFloat64(const CFStringRef inKey, Float64& outValue) const;
- bool GetString(const CFStringRef inKey, CFStringRef& outValue) const;
- bool GetArray(const CFStringRef inKey, CFArrayRef& outValue) const;
- bool GetDictionary(const CFStringRef inKey, CFDictionaryRef& outValue) const;
+ bool GetString(const CFStringRef inKey, CFStringRef& outValue) const;
+ bool GetArray(const CFStringRef inKey, CFArrayRef& outValue) const;
+ bool GetDictionary(const CFStringRef inKey, CFDictionaryRef& outValue) const;
bool GetData(const CFStringRef inKey, CFDataRef& outValue) const;
bool GetCFType(const CFStringRef inKey, CFTypeRef& outValue) const;
-
+
bool GetCFTypeWithCStringKey(const char* inKey, CFTypeRef& outValue) const;
bool AddSInt32(const CFStringRef inKey, SInt32 inValue);
@@ -123,14 +123,14 @@ public:
bool AddDictionary(const CFStringRef inKey, const CFDictionaryRef inValue);
bool AddData(const CFStringRef inKey, const CFDataRef inValue);
bool AddCFType(const CFStringRef inKey, const CFTypeRef inValue);
-
+
bool AddCFTypeWithCStringKey(const char* inKey, const CFTypeRef inValue);
bool AddCString(const CFStringRef inKey, const char* inValue);
void Clear() { if(CanModify()) { CFDictionaryRemoveAllValues(mCFDictionary); } }
-
+
void Show() { CFShow(mCFDictionary); }
-
+
// Implementation
private:
CFMutableDictionaryRef mCFDictionary;
diff --git a/libs/appleutility/CACFNumber.cpp b/libs/appleutility/CACFNumber.cpp
index 3b6160c8bb..edbf3db2d9 100644
--- a/libs/appleutility/CACFNumber.cpp
+++ b/libs/appleutility/CACFNumber.cpp
@@ -53,13 +53,13 @@
Float32 CACFNumber::GetFixed32() const
{
SInt32 theFixedValue = GetSInt32();
-
+
// this is a 16.16 value so convert it to a float
Float32 theSign = theFixedValue < 0 ? -1.0 : 1.0;
theFixedValue *= (SInt32)theSign;
Float32 theWholePart = (theFixedValue & 0x7FFF0000) >> 16;
Float32 theFractPart = theFixedValue & 0x0000FFFF;
theFractPart /= 65536.0;
-
+
return theSign * (theWholePart + theFractPart);
}
diff --git a/libs/appleutility/CACFNumber.h b/libs/appleutility/CACFNumber.h
index 3991637bac..450a94dd47 100644
--- a/libs/appleutility/CACFNumber.h
+++ b/libs/appleutility/CACFNumber.h
@@ -77,7 +77,7 @@ public:
private:
void Retain() { if(mWillRelease && (mCFNumber != NULL)) { CFRetain(mCFNumber); } }
void Release() { if(mWillRelease && (mCFNumber != NULL)) { CFRelease(mCFNumber); } }
-
+
CFNumberRef mCFNumber;
bool mWillRelease;
diff --git a/libs/appleutility/CACFString.cpp b/libs/appleutility/CACFString.cpp
index ec3b18a8b6..5e00b11db6 100644
--- a/libs/appleutility/CACFString.cpp
+++ b/libs/appleutility/CACFString.cpp
@@ -53,13 +53,13 @@
UInt32 CACFString::GetStringByteLength(CFStringRef inCFString, CFStringEncoding inEncoding)
{
UInt32 theAnswer = 0;
-
+
if(inCFString != NULL)
{
CFRange theRange = { 0, CFStringGetLength(inCFString) };
CFStringGetBytes(inCFString, theRange, inEncoding, 0, false, NULL, 0x7FFFFFFF, (CFIndex*)&theAnswer);
}
-
+
return theAnswer;
}
diff --git a/libs/appleutility/CACFString.h b/libs/appleutility/CACFString.h
index 51fa64ebff..4adc460e70 100644
--- a/libs/appleutility/CACFString.h
+++ b/libs/appleutility/CACFString.h
@@ -74,7 +74,7 @@ public:
private:
void Retain() { if(mWillRelease && (mCFString != NULL)) { CFRetain(mCFString); } }
void Release() { if(mWillRelease && (mCFString != NULL)) { CFRelease(mCFString); } }
-
+
CFStringRef mCFString;
bool mWillRelease;
@@ -98,7 +98,7 @@ public:
static UInt32 GetStringByteLength(CFStringRef inCFString, CFStringEncoding inEncoding = kCFStringEncodingUTF8);
static void GetCString(CFStringRef inCFString, char* outString, UInt32& ioStringSize, CFStringEncoding inEncoding = kCFStringEncodingUTF8);
static void GetUnicodeString(CFStringRef inCFString, UInt16* outString, UInt32& ioStringSize);
-
+
};
inline bool operator<(const CACFString& x, const CACFString& y) { return CFStringCompare(x.GetCFString(), y.GetCFString(), 0) == kCFCompareLessThan; }
@@ -129,7 +129,7 @@ public:
private:
void Retain() { if(mWillRelease && (mCFMutableString != NULL)) { CFRetain(mCFMutableString); } }
void Release() { if(mWillRelease && (mCFMutableString != NULL)) { CFRelease(mCFMutableString); } }
-
+
CFMutableStringRef mCFMutableString;
bool mWillRelease;
diff --git a/libs/appleutility/CAComponent.cpp b/libs/appleutility/CAComponent.cpp
index 914e8f3c08..5c9686df36 100644
--- a/libs/appleutility/CAComponent.cpp
+++ b/libs/appleutility/CAComponent.cpp
@@ -94,15 +94,15 @@ OSStatus CAComponent::GetResourceVersion (UInt32 &outVersion) const
ResFileRefNum componentResFileID = kResFileNotOpened;
OSStatus result;
short thngResourceCount;
-
+
short curRes = CurResFile();
require_noerr (result = OpenAComponentResFile( mComp, &componentResFileID), home);
require_noerr (result = componentResFileID <= 0, home);
-
+
UseResFile(componentResFileID);
thngResourceCount = Count1Resources(kComponentResourceType);
-
+
require_noerr (result = ResError(), home);
// only go on if we successfully found at least 1 thng resource
require_noerr (thngResourceCount <= 0 ? -1 : 0, home);
@@ -135,12 +135,12 @@ OSStatus CAComponent::GetResourceVersion (UInt32 &outVersion) const
if (!versionFound)
result = resNotFound;
-
+
UseResFile(curRes); // revert
-
+
if ( componentResFileID != kResFileNotOpened )
CloseComponentResFile(componentResFileID);
-
+
home:
return result;
}
@@ -174,9 +174,9 @@ void CAComponent::SetCompNames () const
Handle h1 = NewHandle(4);
CAComponentDescription desc;
OSStatus err = GetComponentInfo (Comp(), &desc, h1, 0, 0);
-
+
if (err) { DisposeHandle(h1); return; }
-
+
HLock(h1);
char* ptr1 = *h1;
// Get the manufacturer's name... look for the ':' character convention
@@ -184,7 +184,7 @@ void CAComponent::SetCompNames () const
char* displayStr = 0;
const_cast<CAComponent*>(this)->mCompName = CFStringCreateWithPascalString(NULL, (const unsigned char*)*h1, kCFStringEncodingMacRoman);
-
+
for (int i = 0; i < len; ++i) {
if (ptr1[i] == ':') { // found the name
ptr1[i] = 0;
@@ -192,11 +192,11 @@ void CAComponent::SetCompNames () const
break;
}
}
-
+
if (displayStr)
{
const_cast<CAComponent*>(this)->mManuName = CFStringCreateWithCString(NULL, displayStr, kCFStringEncodingMacRoman);
-
+
//move displayStr ptr past the manu, to the name
// we move the characters down a index, because the handle doesn't have any room
// at the end for the \0
@@ -209,7 +209,7 @@ void CAComponent::SetCompNames () const
const_cast<CAComponent*>(this)->mAUName = CFStringCreateWithCString(NULL, displayStr, kCFStringEncodingMacRoman);
}
-
+
DisposeHandle (h1);
}
}
diff --git a/libs/appleutility/CAComponent.h b/libs/appleutility/CAComponent.h
index 2e721d8df9..4009bc42fe 100644
--- a/libs/appleutility/CAComponent.h
+++ b/libs/appleutility/CAComponent.h
@@ -57,59 +57,59 @@ class CAComponent
public:
CAComponent ()
: mComp (0), mDesc(), mManuName(0), mAUName(0), mCompName(0), mCompInfo (0) {}
-
+
// if next is specifed that is used to find the next component after that one
CAComponent (const ComponentDescription& inDesc, CAComponent* next = 0);
-
+
CAComponent (const CAComponent& y)
: mComp (0), mDesc(), mManuName(0), mAUName(0), mCompName(0), mCompInfo (0) { *this = y; }
CAComponent (const Component& comp);
-
+
CAComponent (const ComponentInstance& compInst);
CAComponent (OSType inType, OSType inSubtype = 0, OSType inManu = 0);
-
+
~CAComponent ();
-
+
CAComponent& operator= (const CAComponent& y);
-
+
// returns true if this object references a valid component
bool IsValid () const { return Comp() != 0; }
-
+
bool HasAUStrings() const { SetCompNames (); return mManuName != 0; }
// CFStringRef should be retained by caller if needed beyond lifetime of this object
-
+
// Can return NULL if component doesn't follow AU naming conventions
CFStringRef GetAUManu () const { SetCompNames (); return mManuName; }
CFStringRef GetAUName () const { SetCompNames (); return mAUName ? mAUName : mCompName; }
-
+
// Return value of NULL indicates a problem getting that information from the component
CFStringRef GetCompName () const { SetCompNames(); return mCompName; }
CFStringRef GetCompInfo () const { SetCompInfo(); return mCompInfo; }
-
+
const CAComponentDescription& Desc () const { return mDesc; }
-
+
OSStatus Open (ComponentInstance& outInst) const
{
return OpenAComponent (Comp(), &outInst);
}
OSStatus GetResourceVersion (UInt32 &outVersion) const;
-
+
const Component& Comp() const { return mComp; }
-
+
void Print(FILE* file = stdout) const;
OSStatus Save (CFPropertyListRef *outData) const;
-
+
OSStatus Restore (CFPropertyListRef &inData);
-
+
private:
Component mComp;
CAComponentDescription mDesc;
-
+
CFStringRef mManuName, mAUName, mCompName, mCompInfo;
void SetCompNames () const;
diff --git a/libs/appleutility/CAComponentDescription.cpp b/libs/appleutility/CAComponentDescription.cpp
index 7c3a449955..70e0285501 100644
--- a/libs/appleutility/CAComponentDescription.cpp
+++ b/libs/appleutility/CAComponentDescription.cpp
@@ -73,7 +73,7 @@ void CAComponentDescription::_CAShowComponentDescription(const ComponentDescrip
char str[24];
fprintf (file, "ComponentDescription: %s - ", StringForOSType(desc->componentType, str));
fprintf (file, "%s - ", StringForOSType(desc->componentSubType, str));
- fprintf (file, "%s", StringForOSType(desc->componentManufacturer, str));
+ fprintf (file, "%s", StringForOSType(desc->componentManufacturer, str));
fprintf (file, ", 0x%lX, 0x%lX\n", desc->componentFlags, desc->componentFlagsMask);
}
}
@@ -91,7 +91,7 @@ bool CAComponentDescription::IsAU () const
{
bool flag = IsEffect() || IsMusicDevice() || IsOffline();
if (flag) return true;
-
+
switch (componentType) {
case kAudioUnitType_Output:
case kAudioUnitType_FormatConverter:
@@ -109,15 +109,15 @@ inline bool _MatchTest (const OSType &inTypeA, const OSType &inTypeB)
bool CAComponentDescription::Matches (const ComponentDescription &desc) const
{
bool matches = false;
-
+
// see if the type matches
matches = _MatchTest (componentType, desc.componentType);
-
+
if (matches)
matches = _MatchTest (componentSubType, desc.componentSubType);
-
+
if (matches)
matches = _MatchTest (componentManufacturer, desc.componentManufacturer);
-
+
return matches;
}
diff --git a/libs/appleutility/CAComponentDescription.h b/libs/appleutility/CAComponentDescription.h
index a681902b91..a70d1eb2ec 100644
--- a/libs/appleutility/CAComponentDescription.h
+++ b/libs/appleutility/CAComponentDescription.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAComponentDescription.h
-
+
=============================================================================*/
#ifndef __CAComponentDescription_h__
@@ -73,53 +73,53 @@ void CAShowComponentDescription(const ComponentDescription *desc);
class CAComponentDescription : public ComponentDescription {
public:
CAComponentDescription() { memset (this, 0, sizeof (ComponentDescription)); }
-
+
CAComponentDescription (OSType inType, OSType inSubtype = 0, OSType inManu = 0);
CAComponentDescription(const ComponentDescription& desc) { memcpy (this, &desc, sizeof (ComponentDescription)); }
-
+
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
//
// interrogation
-
+
bool IsAU () const;
-
+
bool IsAUFX() const { return componentType == kAudioUnitType_Effect; }
bool IsAUFM() const { return componentType == kAudioUnitType_MusicEffect; }
-
+
bool IsEffect () const { return IsAUFX() || IsAUFM() || IsPanner(); }
-
+
bool IsOffline () const { return componentType == 'auol'; }
-
+
bool IsFConv () const { return componentType == kAudioUnitType_FormatConverter; }
-
+
bool IsPanner () const { return componentType == kAudioUnitType_Panner; }
-
+
bool IsMusicDevice () const { return componentType == kAudioUnitType_MusicDevice; }
-
+
#ifndef MAC_OS_X_VERSION_10_4
bool IsGenerator () const { return componentType =='augn'; }
#else
bool IsGenerator () const { return componentType ==kAudioUnitType_Generator; }
#endif
-
+
bool IsOutput () const { return componentType == kAudioUnitType_Output; }
-
+
bool IsSource () const { return IsMusicDevice() || IsGenerator(); }
-
+
OSType Type () const { return componentType; }
OSType SubType () const { return componentSubType; }
OSType Manu () const { return componentManufacturer; }
int Count() const { return CountComponents(const_cast<CAComponentDescription*>(this)); }
-
+
// does a semantic match where "wild card" values for type, subtype, manu will match
bool Matches (const ComponentDescription &desc) const;
-
+
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
//
// other
-
+
void Print(FILE* file = stdout) const { _CAShowComponentDescription (this, file); }
OSStatus Save (CFPropertyListRef *outData) const;
diff --git a/libs/appleutility/CADebugMacros.h b/libs/appleutility/CADebugMacros.h
index 1abae40187..58e5387862 100644
--- a/libs/appleutility/CADebugMacros.h
+++ b/libs/appleutility/CADebugMacros.h
@@ -56,10 +56,10 @@
#pragma mark Basic Definitions
#if DEBUG || CoreAudio_Debug
-
+
// can be used to break into debugger immediately, also see CADebugger
#define BusError() (*(long *)0 = 0)
-
+
// basic debugging print routines
#if TARGET_OS_MAC && !TARGET_API_MAC_CARBON
extern pascal void DebugStr(const unsigned char* debuggerMsg);
@@ -69,13 +69,13 @@
#define DebugMessageN3(msg, N1, N2, N3)
#else
#include "CADebugPrintf.h"
-
+
#if (CoreAudio_FlushDebugMessages && !CoreAudio_UseSysLog) || defined(CoreAudio_UseSideFile)
#define FlushRtn ;fflush(DebugPrintfFile)
#else
#define FlushRtn
#endif
-
+
#if CoreAudio_ThreadStampMessages
#include <pthread.h>
#include "CAHostTimeBase.h"
@@ -121,7 +121,7 @@
#else
#define vprint(msg)
#endif
-
+
#if CoreAudio_StopOnFailure
#include "CADebugger.h"
#define STOP CADebuggerStop()
diff --git a/libs/appleutility/CAMath.h b/libs/appleutility/CAMath.h
index 32b4e7f0b3..bc9ec51661 100644
--- a/libs/appleutility/CAMath.h
+++ b/libs/appleutility/CAMath.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAMath.h
-
+
=============================================================================*/
#ifndef __CAMath_h__
diff --git a/libs/appleutility/CAReferenceCounted.h b/libs/appleutility/CAReferenceCounted.h
index 5c9b1168bd..c17b5c38bd 100644
--- a/libs/appleutility/CAReferenceCounted.h
+++ b/libs/appleutility/CAReferenceCounted.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAReferenceCounted.h
-
+
=============================================================================*/
#ifndef __CAReferenceCounted_h__
@@ -57,9 +57,9 @@
class CAReferenceCounted {
public:
CAReferenceCounted() : mRefCount(1) {}
-
+
void retain() { IncrementAtomic(&mRefCount); }
-
+
void release()
{
// this returns the ORIGINAL value, not the new one.
diff --git a/libs/appleutility/CAStreamBasicDescription.cpp b/libs/appleutility/CAStreamBasicDescription.cpp
index e89b898666..bc48dd0f76 100644
--- a/libs/appleutility/CAStreamBasicDescription.cpp
+++ b/libs/appleutility/CAStreamBasicDescription.cpp
@@ -76,7 +76,7 @@ void CAStreamBasicDescription::PrintFormat(FILE *f, const char *indent, const ch
char formatID[5];
*(UInt32 *)formatID = CFSwapInt32HostToBig(mFormatID);
formatID[4] = '\0';
- fprintf(f, "%2ld ch, %6.0f Hz, '%-4.4s' (0x%08lX) ",
+ fprintf(f, "%2ld ch, %6.0f Hz, '%-4.4s' (0x%08lX) ",
NumberChannels(), mSampleRate, formatID,
mFormatFlags);
if (mFormatID == kAudioFormatLinearPCM) {
@@ -99,7 +99,7 @@ void CAStreamBasicDescription::PrintFormat(FILE *f, const char *indent, const ch
((mFormatFlags & kLinearPCMFormatFlagIsAlignedHigh) ? " high-aligned" : " low-aligned") : "";
const char *deinter = (mFormatFlags & kAudioFormatFlagIsNonInterleaved) ? ", deinterleaved" : "";
const char *commaSpace = (packed[0]!='\0') || (align[0]!='\0') ? ", " : "";
-
+
fprintf(f, "%ld-bit%s%s %s%s%s%s%s\n",
mBitsPerChannel, endian, sign, floatInt,
commaSpace, packed, align, deinter);
@@ -124,7 +124,7 @@ void CAStreamBasicDescription::PrintFormat(FILE *f, const char *indent, const ch
fprintf(f, "from %d-bit source, ", sourceBits);
else
fprintf(f, "from UNKNOWN source bit depth, ");
-
+
fprintf(f, "%ld frames/packet\n", mFramesPerPacket);
}
else
@@ -213,7 +213,7 @@ void CAStreamBasicDescription::GetSimpleName(const AudioStreamBasicDescription&
theEndianString = "Little Endian";
#endif
}
-
+
const char* theKindString = NULL;
if((inDescription.mFormatFlags & kAudioFormatFlagIsFloat) != 0)
{
@@ -227,7 +227,7 @@ void CAStreamBasicDescription::GetSimpleName(const AudioStreamBasicDescription&
{
theKindString = (inAbbreviate ? "UInt" : "Unsigned Integer");
}
-
+
const char* thePackingString = NULL;
if((inDescription.mFormatFlags & kAudioFormatFlagIsPacked) == 0)
{
@@ -240,7 +240,7 @@ void CAStreamBasicDescription::GetSimpleName(const AudioStreamBasicDescription&
thePackingString = "Low";
}
}
-
+
const char* theMixabilityString = NULL;
if((inDescription.mFormatFlags & kIsNonMixableFlag) == 0)
{
@@ -250,7 +250,7 @@ void CAStreamBasicDescription::GetSimpleName(const AudioStreamBasicDescription&
{
theMixabilityString = "Unmixable";
}
-
+
if(inAbbreviate)
{
if(theEndianString != NULL)
@@ -303,15 +303,15 @@ void CAStreamBasicDescription::GetSimpleName(const AudioStreamBasicDescription&
}
}
break;
-
+
case kAudioFormatAC3:
strcpy(outName, "AC-3");
break;
-
+
case kAudioFormat60958AC3:
strcpy(outName, "AC-3 for SPDIF");
break;
-
+
default:
{
char* the4CCString = (char*)&inDescription.mFormatID;
@@ -345,9 +345,9 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
{
bool theAnswer = false;
bool isDone = false;
-
+
// note that if either side is 0, that field is skipped
-
+
// format ID is the first order sort
if((!isDone) && ((x.mFormatID != 0) && (y.mFormatID != 0)))
{
@@ -370,8 +370,8 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
isDone = true;
}
}
-
-
+
+
// mixable is always better than non-mixable for linear PCM and should be the second order sort item
if((!isDone) && ((x.mFormatID == kAudioFormatLinearPCM) && (y.mFormatID == kAudioFormatLinearPCM)))
{
@@ -386,7 +386,7 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
isDone = true;
}
}
-
+
// floating point vs integer for linear PCM only
if((!isDone) && ((x.mFormatID == kAudioFormatLinearPCM) && (y.mFormatID == kAudioFormatLinearPCM)))
{
@@ -397,7 +397,7 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
isDone = true;
}
}
-
+
// bit depth
if((!isDone) && ((x.mBitsPerChannel != 0) && (y.mBitsPerChannel != 0)))
{
@@ -408,7 +408,7 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
isDone = true;
}
}
-
+
// sample rate
if((!isDone) && fnonzero(x.mSampleRate) && fnonzero(y.mSampleRate))
{
@@ -419,7 +419,7 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
isDone = true;
}
}
-
+
// number of channels
if((!isDone) && ((x.mChannelsPerFrame != 0) && (y.mChannelsPerFrame != 0)))
{
@@ -430,7 +430,7 @@ bool operator<(const AudioStreamBasicDescription& x, const AudioStreamBasicDescr
isDone = true;
}
}
-
+
return theAnswer;
}
@@ -438,29 +438,29 @@ static bool MatchFormatFlags(const AudioStreamBasicDescription& x, const AudioSt
{
UInt32 xFlags = x.mFormatFlags;
UInt32 yFlags = y.mFormatFlags;
-
+
// match wildcards
if (x.mFormatID == 0 || y.mFormatID == 0 || xFlags == 0 || yFlags == 0)
return true;
-
+
if (x.mFormatID == kAudioFormatLinearPCM)
- {
+ {
// knock off the all clear flag
xFlags = xFlags & ~kAudioFormatFlagsAreAllClear;
yFlags = yFlags & ~kAudioFormatFlagsAreAllClear;
-
+
// if both kAudioFormatFlagIsPacked bits are set, then we don't care about the kAudioFormatFlagIsAlignedHigh bit.
if (xFlags & yFlags & kAudioFormatFlagIsPacked) {
xFlags = xFlags & ~kAudioFormatFlagIsAlignedHigh;
yFlags = yFlags & ~kAudioFormatFlagIsAlignedHigh;
}
-
+
// if both kAudioFormatFlagIsFloat bits are set, then we don't care about the kAudioFormatFlagIsSignedInteger bit.
if (xFlags & yFlags & kAudioFormatFlagIsFloat) {
xFlags = xFlags & ~kAudioFormatFlagIsSignedInteger;
yFlags = yFlags & ~kAudioFormatFlagIsSignedInteger;
}
-
+
// if the bit depth is 8 bits or less and the format is packed, we don't care about endianness
if((x.mBitsPerChannel <= 8) && ((xFlags & kAudioFormatFlagIsPacked) == kAudioFormatFlagIsPacked))
{
@@ -470,7 +470,7 @@ static bool MatchFormatFlags(const AudioStreamBasicDescription& x, const AudioSt
{
yFlags = yFlags & ~kAudioFormatFlagIsBigEndian;
}
-
+
// if the number of channels is 0 or 1, we don't care about non-interleavedness
if (x.mChannelsPerFrame <= 1 && y.mChannelsPerFrame <= 1) {
xFlags &= ~kLinearPCMFormatFlagIsNonInterleaved;
@@ -485,31 +485,31 @@ bool operator==(const AudioStreamBasicDescription& x, const AudioStreamBasicDesc
// the semantics for equality are:
// 1) Values must match exactly
// 2) wildcard's are ignored in the comparison
-
+
#define MATCH(name) ((x.name) == 0 || (y.name) == 0 || (x.name) == (y.name))
-
+
return
// check the sample rate
(fiszero(x.mSampleRate) || fiszero(y.mSampleRate) || fequal(x.mSampleRate, y.mSampleRate))
-
+
// check the format ids
&& MATCH(mFormatID)
-
+
// check the format flags
&& MatchFormatFlags(x, y)
-
+
// check the bytes per packet
&& MATCH(mBytesPerPacket)
-
+
// check the frames per packet
&& MATCH(mFramesPerPacket)
-
+
// check the bytes per frame
&& MATCH(mBytesPerFrame)
-
+
// check the channels per frame
&& MATCH(mChannelsPerFrame)
-
+
// check the channels per frame
&& MATCH(mBitsPerChannel) ;
}
diff --git a/libs/appleutility/CAStreamBasicDescription.h b/libs/appleutility/CAStreamBasicDescription.h
index c9caed5aa0..db3faaea0d 100644
--- a/libs/appleutility/CAStreamBasicDescription.h
+++ b/libs/appleutility/CAStreamBasicDescription.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAStreamBasicDescription.h
-
+
=============================================================================*/
#ifndef __CAStreamBasicDescription_h__
@@ -82,12 +82,12 @@ public:
// Construction/Destruction
public:
CAStreamBasicDescription() { memset (this, 0, sizeof(AudioStreamBasicDescription)); }
-
+
CAStreamBasicDescription(const AudioStreamBasicDescription &desc)
{
SetFrom(desc);
}
-
+
CAStreamBasicDescription( double inSampleRate, UInt32 inFormatID,
UInt32 inBytesPerPacket, UInt32 inFramesPerPacket,
UInt32 inBytesPerFrame, UInt32 inChannelsPerFrame,
@@ -100,31 +100,31 @@ public:
{
memcpy(this, &desc, sizeof(AudioStreamBasicDescription));
}
-
+
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
//
// interrogation
-
+
bool IsPCM() const { return mFormatID == kAudioFormatLinearPCM; }
-
+
bool PackednessIsSignificant() const
{
Assert(IsPCM(), "PackednessIsSignificant only applies for PCM");
return (SampleWordSize() << 3) != mBitsPerChannel;
}
-
+
bool AlignmentIsSignificant() const
{
return PackednessIsSignificant() || (mBitsPerChannel & 7) != 0;
}
-
+
bool IsInterleaved() const
{
return !IsPCM() || !(mFormatFlags & kAudioFormatFlagIsNonInterleaved);
}
-
+
// for sanity with interleaved/deinterleaved possibilities, never access mChannelsPerFrame, use these:
- UInt32 NumberInterleavedChannels() const { return IsInterleaved() ? mChannelsPerFrame : 1; }
+ UInt32 NumberInterleavedChannels() const { return IsInterleaved() ? mChannelsPerFrame : 1; }
UInt32 NumberChannelStreams() const { return IsInterleaved() ? 1 : mChannelsPerFrame; }
UInt32 NumberChannels() const { return mChannelsPerFrame; }
UInt32 SampleWordSize() const { return (mBytesPerFrame > 0) ? mBytesPerFrame / NumberInterleavedChannels() : 0;}
@@ -134,16 +134,16 @@ public:
Assert(mBytesPerFrame > 0, "bytesPerFrame must be > 0 in BytesToFrames");
return nbytes / mBytesPerFrame;
}
-
+
bool SameChannelsAndInterleaving(const CAStreamBasicDescription &a) const
{
return this->NumberChannels() == a.NumberChannels() && this->IsInterleaved() == a.IsInterleaved();
}
-
+
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
//
// manipulation
-
+
void SetCanonical(UInt32 nChannels, bool interleaved)
// note: leaves sample rate untouched
{
@@ -159,7 +159,7 @@ public:
mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
}
}
-
+
void ChangeNumberChannels(UInt32 nChannels, bool interleaved)
// alter an existing format
{
@@ -177,11 +177,11 @@ public:
mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
}
}
-
+
// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
//
// other
-
+
void Print() const
{
Print (stdout);
@@ -189,13 +189,13 @@ public:
void Print(FILE* file) const
{
- PrintFormat (file, "", "AudioStreamBasicDescription:");
+ PrintFormat (file, "", "AudioStreamBasicDescription:");
}
void PrintFormat(FILE *f, const char *indent, const char *name) const;
OSStatus Save(CFPropertyListRef *outData) const;
-
+
OSStatus Restore(CFPropertyListRef &inData);
// Operations
diff --git a/libs/appleutility/CAXException.cpp b/libs/appleutility/CAXException.cpp
index 088575f041..744a77ffa8 100644
--- a/libs/appleutility/CAXException.cpp
+++ b/libs/appleutility/CAXException.cpp
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAXException.cpp
-
+
=============================================================================*/
#include "CAXException.h"
diff --git a/libs/appleutility/CAXException.h b/libs/appleutility/CAXException.h
index 796119763d..b27f833805 100644
--- a/libs/appleutility/CAXException.h
+++ b/libs/appleutility/CAXException.h
@@ -37,7 +37,7 @@
*/
/*=============================================================================
CAXException.h
-
+
=============================================================================*/
#ifndef __CAXException_h__
@@ -68,24 +68,24 @@ public:
} else
strcpy(mOperation, operation);
}
-
+
char *FormatError(char *str) const
{
return FormatError(str, mError);
}
-
+
char mOperation[256];
const OSStatus mError;
-
+
// -------------------------------------------------
-
+
typedef void (*WarningHandler)(const char *msg, OSStatus err);
-
+
/*static void Throw(const char *operation, OSStatus err)
{
throw CAXException(operation, err);
}*/
-
+
static char *FormatError(char *str, OSStatus error)
{
// see if it appears to be a 4-char-code
@@ -98,13 +98,13 @@ public:
sprintf(str, "%ld", error);
return str;
}
-
+
static void Warning(const char *s, OSStatus error)
{
if (sWarningHandler)
(*sWarningHandler)(s, error);
}
-
+
static void SetWarningHandler(WarningHandler f) { sWarningHandler = f; }
private:
static WarningHandler sWarningHandler;
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h
index 25e2518c83..ddea43f889 100644
--- a/libs/ardour/ardour/ardour.h
+++ b/libs/ardour/ardour/ardour.h
@@ -69,7 +69,7 @@ namespace ARDOUR {
LIBARDOUR_API void make_property_quarks ();
extern LIBARDOUR_API PBD::PropertyChange bounds_change;
-
+
extern LIBARDOUR_API const char* const ardour_config_info;
LIBARDOUR_API void find_bindings_files (std::map<std::string,std::string>&);
diff --git a/libs/ardour/ardour/async_midi_port.h b/libs/ardour/ardour/async_midi_port.h
index db86fda798..e28c6922d2 100644
--- a/libs/ardour/ardour/async_midi_port.h
+++ b/libs/ardour/ardour/async_midi_port.h
@@ -77,7 +77,7 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::Port {
static pthread_t get_process_thread () { return _process_thread; }
static bool is_process_thread();
- private:
+ private:
bool _currently_in_cycle;
MIDI::timestamp_t _last_write_timestamp;
bool have_timer;
@@ -90,7 +90,7 @@ class LIBARDOUR_API AsyncMIDIPort : public ARDOUR::MidiPort, public MIDI::Port {
int create_port ();
/** Channel used to signal to the MidiControlUI that input has arrived */
-
+
std::string _connections;
PBD::ScopedConnection connect_connection;
PBD::ScopedConnection halt_connection;
diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h
index 91f463cc7f..f3ec2ed25a 100644
--- a/libs/ardour/ardour/audio_buffer.h
+++ b/libs/ardour/ardour/audio_buffer.h
@@ -103,7 +103,7 @@ public:
const Sample* const src_raw = src + src_offset;
mix_buffers_no_gain(dst_raw, src_raw, len);
-
+
_silent = false;
_written = true;
}
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h
index e4a5dc356d..17e2223680 100644
--- a/libs/ardour/ardour/audio_track.h
+++ b/libs/ardour/ardour/audio_track.h
@@ -71,7 +71,7 @@ class LIBARDOUR_API AudioTrack : public Track
private:
boost::shared_ptr<Diskstream> diskstream_factory (XMLNode const &);
-
+
int deprecated_use_diskstream_connections ();
void set_state_part_two ();
void set_state_part_three ();
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h
index fe5327fd03..41654a811a 100644
--- a/libs/ardour/ardour/audio_unit.h
+++ b/libs/ardour/ardour/audio_unit.h
@@ -93,7 +93,7 @@ class LIBARDOUR_API AUPlugin : public ARDOUR::Plugin
bool parameter_is_control (uint32_t) const;
bool parameter_is_input (uint32_t) const;
bool parameter_is_output (uint32_t) const;
-
+
void set_info (PluginInfoPtr);
int set_state(const XMLNode& node, int);
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index e2ae52996d..330af8d900 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -243,10 +243,10 @@ class LIBARDOUR_API AudioEngine : public SessionHandlePtr, public PortManager
* countdown, whose duration will be reduced to half of its previous
* value.
*/
-
+
PBD::Signal0<void> BecameSilent;
void reset_silence_countdown ();
-
+
private:
AudioEngine ();
@@ -308,10 +308,10 @@ class LIBARDOUR_API AudioEngine : public SessionHandlePtr, public PortManager
#ifdef SILENCE_AFTER
framecnt_t _silence_countdown;
uint32_t _silence_hit_cnt;
-#endif
+#endif
};
-
+
} // namespace ARDOUR
#endif /* __ardour_audioengine_h__ */
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index 3de6de11fa..45b7fea520 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -140,7 +140,7 @@ class LIBARDOUR_API AudioRegion : public Region
void set_default_fade_out ();
framecnt_t verify_xfade_bounds (framecnt_t, bool start);
-
+
void set_envelope_active (bool yn);
void set_default_envelope ();
@@ -187,7 +187,7 @@ class LIBARDOUR_API AudioRegion : public Region
private:
friend class ::AudioRegionReadTest;
friend class ::PlaylistReadTest;
-
+
PBD::Property<bool> _envelope_active;
PBD::Property<bool> _default_fade_in;
PBD::Property<bool> _default_fade_out;
diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h
index cfeaeafa86..bc47f2fe06 100644
--- a/libs/ardour/ardour/automation_list.h
+++ b/libs/ardour/ardour/automation_list.h
@@ -52,9 +52,9 @@ public:
AutomationListProperty (PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > d, Ptr o, Ptr c)
: PBD::SharedStatefulProperty<AutomationList> (d.property_id, o, c)
{}
-
+
PBD::PropertyBase* clone () const;
-
+
private:
/* No copy-construction nor assignment */
AutomationListProperty (AutomationListProperty const &);
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index 8d196b36d7..0c14d2a049 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -65,10 +65,10 @@ class LIBARDOUR_API ControlProtocolManager : public PBD::Stateful, public ARDOUR
void load_mandatory_protocols ();
void midi_connectivity_established ();
void drop_protocols ();
-
+
int activate (ControlProtocolInfo&);
int deactivate (ControlProtocolInfo&);
-
+
std::list<ControlProtocolInfo*> control_protocol_info;
static const std::string state_node_name;
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index e19eef719f..13e1cdcda3 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -114,7 +114,7 @@ public:
private:
bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master;
-
+
static bool panners_legal;
static PBD::Signal0<void> PannersLegal;
diff --git a/libs/ardour/ardour/engine_state_controller.h b/libs/ardour/ardour/engine_state_controller.h
index 76ed08b3ab..7cf4e057dc 100644
--- a/libs/ardour/ardour/engine_state_controller.h
+++ b/libs/ardour/ardour/engine_state_controller.h
@@ -472,7 +472,7 @@ class EngineStateController
std::string device_name; ///< state device name
ARDOUR::framecnt_t sample_rate; ///< sample rate used by the device in this state
ARDOUR::pframes_t buffer_size; ///< buffer size used by the device in this state
-
+
PortStateList input_channel_states; ///< states of device Audio inputs
PortStateList multi_out_channel_states; ///< states of device Audio inputs in Multi Out mode
PortStateList stereo_out_channel_states; ///< states of device Audio inputs in Stereo Out mode
diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h
index 87a7729887..1223fa2d4b 100644
--- a/libs/ardour/ardour/export_format_specification.h
+++ b/libs/ardour/ardour/export_format_specification.h
@@ -114,36 +114,36 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
std::string format_name () const { return _format_name; }
Type type () const { return _type; }
-
+
FormatId format_id () const {
if (!format_ids.empty() )
return *format_ids.begin();
else
return FormatId(0);
}
-
+
Endianness endianness () const {
if (!endiannesses.empty() )
return *endiannesses.begin();
else
return Endianness(0);
}
-
+
SampleFormat sample_format () const {
if (!sample_formats.empty() )
return *sample_formats.begin();
else
return SampleFormat(0);
}
-
+
SampleRate sample_rate () const {
if (!sample_rates.empty() )
return *sample_rates.begin();
else
return SampleRate(0);
-
+
}
-
+
Quality quality () const {
if (!qualities.empty() )
return *qualities.begin();
diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h
index 0929c3303f..00fb74b426 100644
--- a/libs/ardour/ardour/file_source.h
+++ b/libs/ardour/ardour/file_source.h
@@ -47,7 +47,7 @@ public:
virtual ~FileSource ();
const std::string& path() const { return _path; }
-
+
virtual bool safe_file_extension (const std::string& path) const = 0;
int move_to_trash (const std::string& trash_dir_name);
@@ -79,7 +79,7 @@ public:
const std::string& origin() const { return _origin; }
virtual void set_path (const std::string&);
-
+
static PBD::Signal2<int,std::string,std::vector<std::string> > AmbiguousFileName;
void existence_check ();
diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h
index 7a2ac9455a..2d4a0adb30 100644
--- a/libs/ardour/ardour/graph.h
+++ b/libs/ardour/ardour/graph.h
@@ -45,7 +45,7 @@ class Graph;
class Route;
class Session;
-class GraphEdges;
+class GraphEdges;
typedef boost::shared_ptr<GraphNode> node_ptr_t;
diff --git a/libs/ardour/ardour/graphnode.h b/libs/ardour/ardour/graphnode.h
index 55867eac4c..aa04d9b20a 100644
--- a/libs/ardour/ardour/graphnode.h
+++ b/libs/ardour/ardour/graphnode.h
@@ -37,7 +37,7 @@ typedef boost::shared_ptr<GraphNode> node_ptr_t;
typedef std::set< node_ptr_t > node_set_t;
typedef std::list< node_ptr_t > node_list_t;
-/** A node on our processing graph, ie a Route */
+/** A node on our processing graph, ie a Route */
class LIBARDOUR_API GraphNode
{
public:
diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h
index b55a976023..17ebf86034 100644
--- a/libs/ardour/ardour/midi_diskstream.h
+++ b/libs/ardour/ardour/midi_diskstream.h
@@ -71,7 +71,7 @@ class LIBARDOUR_API MidiDiskstream : public Diskstream
void set_record_enabled (bool yn);
void set_record_safe (bool yn);
-
+
void reset_tracker ();
void resolve_tracker (Evoral::EventSink<framepos_t>& buffer, framepos_t time);
diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h
index b410f3d5af..eb90dc1e35 100644
--- a/libs/ardour/ardour/midi_port.h
+++ b/libs/ardour/ardour/midi_port.h
@@ -57,7 +57,7 @@ class LIBARDOUR_API MidiPort : public Port {
void set_always_parse (bool yn);
void set_trace_on (bool yn);
-
+
MIDI::Parser& self_parser() { return _self_parser; }
protected:
@@ -72,7 +72,7 @@ class LIBARDOUR_API MidiPort : public Port {
bool _input_active;
bool _always_parse;
bool _trace_on;
-
+
/* Naming this is tricky. AsyncMIDIPort inherits (for now, aug 2013) from
* both MIDI::Port, which has _parser, and this (ARDOUR::MidiPort). We
* need parsing support in this object, independently of what the
diff --git a/libs/ardour/ardour/midi_scene_change.h b/libs/ardour/ardour/midi_scene_change.h
index 41167f167d..245b749272 100644
--- a/libs/ardour/ardour/midi_scene_change.h
+++ b/libs/ardour/ardour/midi_scene_change.h
@@ -62,6 +62,6 @@ class MIDISceneChange : public SceneChange
};
} /* namespace */
-
+
#endif /* __libardour_scene_change_h__ */
diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h
index 2ba57e4e01..c48f384ce9 100644
--- a/libs/ardour/ardour/midi_track.h
+++ b/libs/ardour/ardour/midi_track.h
@@ -150,7 +150,7 @@ private:
MidiChannelFilter _capture_filter;
virtual boost::shared_ptr<Diskstream> diskstream_factory (XMLNode const &);
-
+
boost::shared_ptr<MidiDiskstream> midi_diskstream () const;
void write_out_of_band_data (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, framecnt_t nframes);
diff --git a/libs/ardour/ardour/midiport_manager.h b/libs/ardour/ardour/midiport_manager.h
index fade9c8beb..4e0f98cb3c 100644
--- a/libs/ardour/ardour/midiport_manager.h
+++ b/libs/ardour/ardour/midiport_manager.h
@@ -42,7 +42,7 @@ class LIBARDOUR_API MidiPortManager {
public:
MidiPortManager();
virtual ~MidiPortManager ();
-
+
/* Ports used for control. These are read/written to outside of the
* process callback (asynchronously with respect to when data
* actually arrives).
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index 56c65a4dc2..1838fb5f56 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -159,7 +159,7 @@ public:
int set_state (const XMLNode&, int version);
XMLNode& get_state ();
-
+
boost::shared_ptr<Pannable> pannable() const { return _pannable; }
static bool equivalent (pan_t a, pan_t b) {
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 1b3f1d530f..de5a5dcb05 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -237,7 +237,7 @@ public:
void set_layer (boost::shared_ptr<Region>, double);
void set_capture_insertion_in_progress (bool yn);
-
+
protected:
friend class Session;
diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h
index c927c1c061..f9831afcad 100644
--- a/libs/ardour/ardour/plugin.h
+++ b/libs/ardour/ardour/plugin.h
@@ -144,11 +144,11 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
struct PresetRecord {
PresetRecord () : number (-1), user (true) {}
PresetRecord (const std::string& u, const std::string& l, int n = -1, bool s = true) : uri (u), label (l), number (n), user (s) {}
-
+
bool operator!= (PresetRecord const & a) const {
return number != a.number || uri != a.uri || label != a.label;
}
-
+
std::string uri;
std::string label;
int number; // if <0, invalid
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h
index f9578a188d..8788778a3a 100644
--- a/libs/ardour/ardour/plugin_insert.h
+++ b/libs/ardour/ardour/plugin_insert.h
@@ -191,7 +191,7 @@ class LIBARDOUR_API PluginInsert : public Processor
struct Match {
Match () : method (Impossible), plugins (0) {}
Match (MatchingMethod m, int32_t p, ChanCount h = ChanCount ()) : method (m), plugins (p), hide (h) {}
-
+
MatchingMethod method; ///< method to employ
int32_t plugins; ///< number of copies of the plugin that we need
ChanCount hide; ///< number of channels to hide
diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h
index 663bb92324..2c081ddfa3 100644
--- a/libs/ardour/ardour/plugin_manager.h
+++ b/libs/ardour/ardour/plugin_manager.h
@@ -135,7 +135,7 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable {
int windows_vst_discover_from_path (std::string path, bool cache_only = false);
int windows_vst_discover (std::string path, bool cache_only = false);
-
+
int lxvst_discover_from_path (std::string path, bool cache_only = false);
int lxvst_discover (std::string path, bool cache_only = false);
diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h
index d76016c6a3..97b7a9c2f5 100644
--- a/libs/ardour/ardour/port_manager.h
+++ b/libs/ardour/ardour/port_manager.h
@@ -106,11 +106,11 @@ class LIBARDOUR_API PortManager
public:
PortRegistrationFailure (std::string const & why = "")
: reason (why) {}
-
+
~PortRegistrationFailure () throw () {}
-
+
const char *what() const throw () { return reason.c_str(); }
-
+
private:
std::string reason;
};
@@ -157,7 +157,7 @@ class LIBARDOUR_API PortManager
* Realtime safe.
*/
void cycle_start (pframes_t nframes);
-
+
/** Signal the end of an audio cycle.
* This signifies that the cycle began with @ref cycle_start has ended.
* This MUST be called at the end of each cycle.
@@ -167,7 +167,7 @@ class LIBARDOUR_API PortManager
};
-
+
} // namespace
#endif /* __libardour_port_manager_h__ */
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 54cfd57fea..60999bf73a 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -153,7 +153,7 @@ class LIBARDOUR_API Region
Evoral::Range<framepos_t> last_range () const {
return Evoral::Range<framepos_t> (_last_position, _last_position + _last_length - 1);
}
-
+
Evoral::Range<framepos_t> range () const {
return Evoral::Range<framepos_t> (first_frame(), last_frame());
}
@@ -354,7 +354,7 @@ class LIBARDOUR_API Region
virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
virtual void set_length_internal (framecnt_t);
virtual void set_start_internal (framecnt_t);
-
+
DataType _type;
PBD::Property<bool> _sync_marked;
@@ -366,15 +366,15 @@ class LIBARDOUR_API Region
PBD::Property<framepos_t> _position;
/** Sync position relative to the start of our file */
PBD::Property<framepos_t> _sync_position;
-
+
SourceList _sources;
/** Used when timefx are applied, so we can always use the original source */
SourceList _master_sources;
AnalysisFeatureList _transients;
-
+
boost::weak_ptr<ARDOUR::Playlist> _playlist;
-
+
private:
void mid_thaw (const PBD::PropertyChange&);
diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h
index d5228fadb7..08d9affc91 100644
--- a/libs/ardour/ardour/region_factory.h
+++ b/libs/ardour/ardour/region_factory.h
@@ -117,7 +117,7 @@ public:
* announce=false but they still need to be in the map soon after
* creation.
*/
-
+
static void map_add (boost::shared_ptr<Region>);
private:
diff --git a/libs/ardour/ardour/revision.h b/libs/ardour/ardour/revision.h
index 7d746f2e2f..da589278b2 100644
--- a/libs/ardour/ardour/revision.h
+++ b/libs/ardour/ardour/revision.h
@@ -25,7 +25,7 @@
namespace ARDOUR {
extern LIBARDOUR_API const char* revision;
-
+
extern "C" {
LIBARDOUR_API const char* get_ardour_revision();
}
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index c4decd48c8..d59c1e0610 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -113,7 +113,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
virtual MonitorState monitoring_state () const;
virtual MeterState metering_state () const;
-
+
/* these are the core of the API of a Route. see the protected sections as well */
virtual int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
@@ -152,7 +152,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
bool muted () const;
void set_mute (bool yn, void* src);
-
+
bool muted_by_others() const;
/* controls use set_solo() to modify this route's solo state
@@ -547,7 +547,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
uint32_t _solo_isolated_by_upstream;
void mod_solo_isolated_by_upstream (bool, void*);
-
+
bool _denormal_protection;
bool _recordable : 1;
@@ -668,7 +668,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
Route (Route const &);
void maybe_note_meter_position ();
-
+
/** true if we've made a note of a custom meter position in these variables */
bool _custom_meter_position_noted;
/** the processor that came after the meter when it was last set to a custom position,
diff --git a/libs/ardour/ardour/route_graph.h b/libs/ardour/ardour/route_graph.h
index 77e74ceafd..e1e1049cd6 100644
--- a/libs/ardour/ardour/route_graph.h
+++ b/libs/ardour/ardour/route_graph.h
@@ -41,7 +41,7 @@ class LIBARDOUR_API GraphEdges
{
public:
typedef std::map<GraphVertex, std::set<GraphVertex> > EdgeMap;
-
+
void add (GraphVertex from, GraphVertex to, bool via_sends_only);
bool has (GraphVertex from, GraphVertex to, bool* via_sends_only);
std::set<GraphVertex> from (GraphVertex r) const;
@@ -49,12 +49,12 @@ public:
bool has_none_to (GraphVertex to) const;
bool empty () const;
void dump () const;
-
+
private:
void insert (EdgeMap& e, GraphVertex a, GraphVertex b);
-
+
typedef std::multimap<GraphVertex, std::pair<GraphVertex, bool> > EdgeMapWithSends;
-
+
EdgeMapWithSends::iterator find_in_from_to_with_sends (GraphVertex, GraphVertex);
/** map of edges with from as `first' and to as `second' */
diff --git a/libs/ardour/ardour/scene_change.h b/libs/ardour/ardour/scene_change.h
index 1513622ed0..adb65546b5 100644
--- a/libs/ardour/ardour/scene_change.h
+++ b/libs/ardour/ardour/scene_change.h
@@ -54,6 +54,6 @@ class SceneChange : public PBD::Stateful
};
} /* namespace */
-
+
#endif /* __libardour_scene_change_h__ */
diff --git a/libs/ardour/ardour/scene_changer.h b/libs/ardour/ardour/scene_changer.h
index 6019ed9c6c..4b837f4cdb 100644
--- a/libs/ardour/ardour/scene_changer.h
+++ b/libs/ardour/ardour/scene_changer.h
@@ -45,12 +45,12 @@ class SceneChanger : public SessionHandleRef
public:
SceneChanger (Session& s) : SessionHandleRef (s) {}
virtual ~SceneChanger () {};
-
+
virtual void run (framepos_t start, framepos_t end) = 0;
virtual void locate (framepos_t where) = 0;
};
} /* namespace */
-
+
#endif /* __libardour_scene_change_h__ */
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index 17343bff96..f944dcabfb 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -72,7 +72,7 @@ class LIBARDOUR_API Send : public Delivery
bool set_name (const std::string& str);
std::string value_as_string (boost::shared_ptr<AutomationControl>) const;
-
+
static uint32_t how_many_sends();
static std::string name_and_id_new_send (Session&, Delivery::Role r, uint32_t&, bool);
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 2e6024badb..3d280be016 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -312,7 +312,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
/* Timecode status signals */
PBD::Signal1<void, bool> MTCSyncStateChanged;
- PBD::Signal1<void, bool> LTCSyncStateChanged;
+ PBD::Signal1<void, bool> LTCSyncStateChanged;
/* Record status signals */
@@ -362,7 +362,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
/* Timecode state signals */
PBD::Signal0<void> MtcOrLtcInputPortChanged;
-
+
void queue_event (SessionEvent*);
void request_roll_at_and_return (framepos_t start, framepos_t return_to);
@@ -427,7 +427,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
framecnt_t worst_input_latency () const { return _worst_input_latency; }
framecnt_t worst_track_latency () const { return _worst_track_latency; }
framecnt_t worst_playback_latency () const { return _worst_output_latency + _worst_track_latency; }
-
+
struct SaveAs {
std::string new_parent_folder; /* parent folder where new session folder will be created */
std::string new_name; /* name of newly saved session */
@@ -437,7 +437,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
bool copy_external; /* true if external media should be consolidated into the newly saved session; false otherwise */
std::string final_session_folder_name; /* filled in by * Session::save_as(), provides full path to newly saved session */
-
+
/* emitted as we make progress. 3 arguments passed to signal
* handler:
*
@@ -582,7 +582,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
AudioEngine const & engine () const { return _engine; }
static std::string default_track_name_pattern (DataType);
-
+
/* Time */
framepos_t transport_frame () const {return _transport_frame; }
@@ -625,7 +625,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
bool synced_to_engine() const { return _slave && config.get_external_sync() && Config->get_sync_source() == Engine; }
bool synced_to_mtc () const { return config.get_external_sync() && Config->get_sync_source() == MTC && g_atomic_int_get (const_cast<gint*>(&_mtc_active)); }
bool synced_to_ltc () const { return config.get_external_sync() && Config->get_sync_source() == LTC && g_atomic_int_get (const_cast<gint*>(&_ltc_active)); }
-
+
double transport_speed() const { return _transport_speed; }
bool transport_stopped() const { return _transport_speed == 0.0f; }
bool transport_rolling() const { return _transport_speed != 0.0f; }
@@ -877,7 +877,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void set_object_selection (framepos_t start, framepos_t end);
void clear_range_selection ();
void clear_object_selection ();
-
+
/* buffers for gain and pan */
gain_t* gain_automation_buffer () const;
@@ -901,7 +901,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void* ptr,
float opt
);
-
+
static PBD::Signal0<void> SendFeedback;
/* Speakers */
@@ -1025,7 +1025,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
boost::shared_ptr<MidiPort> scene_in () const;
boost::shared_ptr<MidiPort> scene_out () const;
-
+
boost::shared_ptr<MidiPort> midi_clock_output_port () const;
boost::shared_ptr<MidiPort> midi_clock_input_port () const;
boost::shared_ptr<MidiPort> mtc_output_port () const;
@@ -1039,7 +1039,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void reconnect_ltc_input ();
void reconnect_ltc_output ();
-
+
protected:
friend class AudioEngine;
void set_block_size (pframes_t nframes);
@@ -1115,7 +1115,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
PBD::ScopedConnection mtc_status_connection;
void ltc_status_changed (bool);
PBD::ScopedConnection ltc_status_connection;
-
+
void initialize_latencies ();
void set_worst_io_latencies ();
void set_worst_playback_latency ();
@@ -1319,7 +1319,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
int post_engine_init ();
int immediately_post_engine ();
void remove_empty_sounds ();
-
+
void session_loaded ();
void setup_midi_control ();
@@ -1485,7 +1485,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void set_track_loop (bool);
bool select_playhead_priority_target (framepos_t&);
void follow_playhead_priority ();
-
+
/* These are synchronous and so can only be called from within the process
* cycle
*/
@@ -1712,7 +1712,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
*/
Evoral::Range<framepos_t> _range_selection;
Evoral::Range<framepos_t> _object_selection;
-
+
/* main outs */
uint32_t main_outs;
@@ -1770,7 +1770,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
ev->rt_slot = boost::bind (method, this, rl, targ, group_override);
ev->rt_return = after;
ev->event_loop = PBD::EventLoop::get_event_loop_for_thread ();
-
+
return ev;
}
@@ -1824,16 +1824,16 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
/* Scene Changing */
SceneChanger* _scene_changer;
-
+
/* persistent, non-track related MIDI ports */
MidiPortManager* _midi_ports;
MIDI::MachineControl* _mmc;
-
+
void setup_ltc ();
void setup_click ();
void setup_click_state (const XMLNode*);
void setup_bundles ();
-
+
void save_as_bring_callback (uint32_t, uint32_t, std::string);
static int get_session_info_from_path (XMLTree& state_tree, const std::string& xmlpath);
diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h
index 02759bba7e..cca7f1274e 100644
--- a/libs/ardour/ardour/session_event.h
+++ b/libs/ardour/ardour/session_event.h
@@ -139,7 +139,7 @@ public:
static void init_event_pool ();
CrossThreadPool* event_pool() const { return own_pool; }
-
+
private:
static PerThreadPool* pool;
CrossThreadPool* own_pool;
diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h
index 61a5737afa..22bfc1f032 100644
--- a/libs/ardour/ardour/session_route.h
+++ b/libs/ardour/ardour/session_route.h
@@ -34,11 +34,11 @@ Session::foreach_route (T *obj, void (T::*func)(Route&), bool sort)
{
boost::shared_ptr<RouteList> r = routes.reader();
RouteList public_order (*r);
-
+
if (sort) {
public_order.sort (RoutePublicOrderSorter());
}
-
+
for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) {
(obj->*func) (**i);
}
@@ -64,7 +64,7 @@ Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort)
{
boost::shared_ptr<RouteList> r = routes.reader();
RouteList public_order (*r);
-
+
if (sort) {
public_order.sort (RoutePublicOrderSorter());
}
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h
index bda47ceba0..cf8060d029 100644
--- a/libs/ardour/ardour/slave.h
+++ b/libs/ardour/ardour/slave.h
@@ -238,19 +238,19 @@ struct LIBARDOUR_API SafeTime {
class LIBARDOUR_API TimecodeSlave : public Slave {
public:
TimecodeSlave () {}
-
+
virtual Timecode::TimecodeFormat apparent_timecode_format() const = 0;
-
+
/* this is intended to be used by a UI and polled from a timeout. it should
return a string describing the current position of the TC source. it
should NOT do any computation, but should use a cached value
of the TC source position.
*/
virtual std::string approximate_current_position() const = 0;
-
+
framepos_t timecode_offset;
bool timecode_negative_offset;
-
+
PBD::Signal1<void, bool> ActiveChanged;
};
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index 35e0c89297..8f58fda2fe 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -86,7 +86,7 @@ public:
mutable framepos_t _smf_last_read_time;
int open_for_write ();
-
+
void ensure_disk_file (const Lock& lock);
framecnt_t read_unlocked (const Lock& lock,
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index 09b3d8b5eb..bb22a79c8e 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -158,7 +158,7 @@ class LIBARDOUR_API TempoSection : public MetricSection, public Tempo {
the tempo section is located in. A value of 0.0 indicates that
it occurs on the first beat of the bar, a value of 0.5 indicates
that it occurs halfway through the bar and so on.
-
+
this enables us to keep the tempo change at the same relative
position within the bar if/when the meter changes.
*/
@@ -228,7 +228,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
BBTPoint (const MeterSection& m, const TempoSection& t, framepos_t f,
uint32_t b, uint32_t e)
: frame (f), meter (&m), tempo (&t), bar (b), beat (e) {}
-
+
Timecode::BBT_Time bbt() const { return Timecode::BBT_Time (bar, beat, 0); }
operator Timecode::BBT_Time() const { return bbt(); }
operator framepos_t() const { return frame; }
@@ -244,13 +244,13 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
void get_grid (BBTPointList::const_iterator&, BBTPointList::const_iterator&,
framepos_t start, framepos_t end);
-
+
/* TEMPO- AND METER-SENSITIVE FUNCTIONS
bbt_time(), bbt_time_rt(), frame_time() and bbt_duration_at()
are all sensitive to tempo and meter, and will give answers
that align with the grid formed by tempo and meter sections.
-
+
They SHOULD NOT be used to determine the position of events
whose location is canonically defined in beats.
*/
@@ -266,7 +266,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
framecnt_t bbt_duration_at (framepos_t, const Timecode::BBT_Time&, int dir);
/* TEMPO-SENSITIVE FUNCTIONS
-
+
These next 4 functions will all take tempo in account and should be
used to determine position (and in the last case, distance in beats)
when tempo matters but meter does not.
@@ -324,7 +324,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
void insert_time (framepos_t, framecnt_t);
bool remove_time (framepos_t where, framecnt_t amount); //returns true if anything was moved
-
+
int n_tempos () const;
int n_meters () const;
@@ -335,7 +335,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
friend class ::BBTTest;
friend class ::FrameposPlusBeatsTest;
friend class ::TempoTest;
-
+
static Tempo _default_tempo;
static Meter _default_meter;
@@ -355,16 +355,16 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
BBTPointList::const_iterator bbt_before_or_at (framepos_t);
BBTPointList::const_iterator bbt_before_or_at (const Timecode::BBT_Time&);
BBTPointList::const_iterator bbt_after_or_at (framepos_t);
-
+
framepos_t round_to_type (framepos_t fr, RoundMode dir, BBTPointType);
void bbt_time (framepos_t, Timecode::BBT_Time&, const BBTPointList::const_iterator&);
framecnt_t bbt_duration_at_unlocked (const Timecode::BBT_Time& when, const Timecode::BBT_Time& bbt, int dir);
-
+
const MeterSection& first_meter() const;
MeterSection& first_meter();
const TempoSection& first_tempo() const;
TempoSection& first_tempo();
-
+
void do_insert (MetricSection* section);
void add_tempo_locked (const Tempo&, Timecode::BBT_Time where, bool recompute);
diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h
index 2d67a0aa75..31ae261ea7 100644
--- a/libs/ardour/ardour/track.h
+++ b/libs/ardour/ardour/track.h
@@ -57,7 +57,7 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream
PBD::Signal0<void> MonitoringChanged;
MeterState metering_state () const;
-
+
virtual int no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool state_changing);
@@ -221,13 +221,13 @@ class LIBARDOUR_API Track : public Route, public PublicDiskstream
void maybe_declick (BufferSet&, framecnt_t, int);
boost::shared_ptr<RecEnableControl> _rec_enable_control;
-
+
framecnt_t check_initial_delay (framecnt_t nframes, framepos_t&);
private:
virtual boost::shared_ptr<Diskstream> diskstream_factory (XMLNode const &) = 0;
-
+
void diskstream_playlist_changed ();
void diskstream_record_enable_changed ();
void diskstream_record_safe_changed ();
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index d073588b9e..f3767d471a 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -93,7 +93,7 @@ gain_to_slider_position (ARDOUR::gain_t g)
K = 7.8990885960495589E+00
*/
-
+
return 8.2857630370864188E-01 * pow(g,5.1526743785019269E-01) * exp (-g/7.8990885960495589E+00);
#else
return pow((6.0*log(g)/log(2.0)+192.0)/198.0, 8.0);
@@ -110,9 +110,9 @@ slider_position_to_gain (double pos)
#ifndef OLD_GAIN_MATH
/* 5th order polynomial function fit to data from a TC Spectra console
fader (image of fader gradations).
-
+
y = a + bx1 + cx2 + dx3 + fx4 + gx5
-
+
a = -1.1945480381045521E-02
b = 1.5809476525537265E+00
c = -1.5850710838966151E+01
diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h
index 3450e2a480..8e2e313c1f 100644
--- a/libs/ardour/ardour/vst_plugin.h
+++ b/libs/ardour/ardour/vst_plugin.h
@@ -56,7 +56,7 @@ public:
bool parameter_is_control (uint32_t) const { return true; }
bool parameter_is_input (uint32_t) const { return true; }
bool parameter_is_output (uint32_t) const { return false; }
-
+
int connect_and_run (
BufferSet&, ChanMapping in, ChanMapping out,
pframes_t nframes, framecnt_t offset
@@ -70,7 +70,7 @@ public:
void print_parameter (uint32_t, char*, uint32_t len) const;
bool has_editor () const;
-
+
AEffect * plugin () const { return _plugin; }
VSTState * state () const { return _state; }
MidiBuffer * midi_buffer () const { return _midi_out_buf; }
@@ -78,7 +78,7 @@ public:
int set_state (XMLNode const &, int);
int first_user_preset_index () const;
-
+
protected:
void set_plugin (AEffect *);
gchar* get_chunk (bool) const;
@@ -91,7 +91,7 @@ protected:
XMLTree * presets_tree () const;
std::string presets_file () const;
void find_presets ();
-
+
VSTHandle* _handle;
VSTState* _state;
AEffect* _plugin;
diff --git a/libs/ardour/ardour/vst_types.h b/libs/ardour/ardour/vst_types.h
index 9d4fc3450f..2e1c4074f2 100644
--- a/libs/ardour/ardour/vst_types.h
+++ b/libs/ardour/ardour/vst_types.h
@@ -44,12 +44,12 @@ struct LIBARDOUR_API _VSTInfo
int numInputs;
int numOutputs;
int numParams;
-
+
int wantMidi;
int wantEvents;
int hasEditor;
int canProcessReplacing;
-
+
char** ParamNames;
char** ParamLabels;
};
@@ -63,7 +63,7 @@ struct LIBARDOUR_API _VSTHandle
void* dll;
char* name;
char* path;
-
+
main_entry_t main_entry;
int plugincnt;
@@ -83,13 +83,13 @@ struct LIBARDOUR_API _VSTState
void* windows_window;
int xid; ///< X11 XWindow
-
+
int want_resize; ///< Set to signal the plugin resized its UI
void* extra_data; ///< Pointer to any extra data
-
+
void * event_callback_thisptr;
void (* eventProc) (void * event);
-
+
VSTHandle* handle;
int width;
@@ -102,9 +102,9 @@ struct LIBARDOUR_API _VSTState
int destroy;
int vst_version;
int has_editor;
-
+
int program_set_without_editor;
-
+
int want_program;
int want_chunk;
int n_pending_keys;
@@ -112,7 +112,7 @@ struct LIBARDOUR_API _VSTState
int wanted_chunk_size;
float * want_params;
float * set_params;
-
+
VSTKey pending_keys[16];
int dispatcher_wantcall;
diff --git a/libs/ardour/ardour/windows_vst_plugin.h b/libs/ardour/ardour/windows_vst_plugin.h
index 17b72ac8da..c4648564af 100644
--- a/libs/ardour/ardour/windows_vst_plugin.h
+++ b/libs/ardour/ardour/windows_vst_plugin.h
@@ -26,7 +26,7 @@ struct LIBARDOUR_API _VSTHandle;
typedef struct _VSTHandle VSTHandle;
namespace ARDOUR {
-
+
class AudioEngine;
class Session;
diff --git a/libs/ardour/async_midi_port.cc b/libs/ardour/async_midi_port.cc
index 86f111b520..6c5625e716 100644
--- a/libs/ardour/async_midi_port.cc
+++ b/libs/ardour/async_midi_port.cc
@@ -73,15 +73,15 @@ AsyncMIDIPort::flush_output_fifo (MIDI::pframes_t nframes)
output_fifo.get_read_vector (&vec);
MidiBuffer& mb (get_midi_buffer (nframes));
-
+
if (vec.len[0]) {
Evoral::Event<double>* evp = vec.buf[0];
-
+
for (size_t n = 0; n < vec.len[0]; ++n, ++evp) {
mb.push_back (evp->time(), evp->size(), evp->buffer());
}
}
-
+
if (vec.len[1]) {
Evoral::Event<double>* evp = vec.buf[1];
@@ -89,7 +89,7 @@ AsyncMIDIPort::flush_output_fifo (MIDI::pframes_t nframes)
mb.push_back (evp->time(), evp->size(), evp->buffer());
}
}
-
+
if ((written = vec.len[0] + vec.len[1]) != 0) {
output_fifo.increment_read_idx (written);
}
@@ -108,7 +108,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
if (ARDOUR::Port::sends_output()) {
flush_output_fifo (nframes);
}
-
+
/* copy incoming data from the port buffer into the input FIFO
and if necessary wakeup the reader
*/
@@ -116,7 +116,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
if (ARDOUR::Port::receives_input()) {
MidiBuffer& mb (get_midi_buffer (nframes));
framecnt_t when;
-
+
if (have_timer) {
when = timer ();
} else {
@@ -194,7 +194,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
/* this is the best estimate of "when" this MIDI data is being
* delivered
*/
-
+
_parser->set_timestamp (AudioEngine::instance()->sample_time() + timestamp);
for (size_t n = 0; n < msglen; ++n) {
_parser->scanner (msg[n]);
@@ -202,7 +202,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
Glib::Threads::Mutex::Lock lm (output_fifo_lock);
RingBuffer< Evoral::Event<double> >::rw_vector vec = { { 0, 0 }, { 0, 0} };
-
+
output_fifo.get_write_vector (&vec);
if (vec.len[0] + vec.len[1] < 1) {
@@ -223,7 +223,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
}
output_fifo.increment_write_idx (1);
-
+
ret = msglen;
} else {
@@ -249,11 +249,11 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
if (_currently_in_cycle) {
MidiBuffer& mb (get_midi_buffer (_cycle_nframes));
-
+
if (timestamp == 0) {
timestamp = _last_write_timestamp;
}
-
+
if (mb.push_back (timestamp, msglen, msg)) {
ret = msglen;
_last_write_timestamp = timestamp;
@@ -279,7 +279,7 @@ AsyncMIDIPort::read (MIDI::byte *, size_t)
if (!ARDOUR::Port::receives_input()) {
return 0;
}
-
+
timestamp_t time;
Evoral::EventType type;
uint32_t size;
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 31baf47039..3d719cc30b 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -524,7 +524,7 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
Sample *buf = bufs.get_audio (n).data(rec_offset);
memcpy (chaninfo->current_capture_buffer, buf, sizeof (Sample) * rec_nframes);
-
+
} else {
framecnt_t total = chaninfo->capture_vector.len[0] + chaninfo->capture_vector.len[1];
@@ -600,7 +600,7 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
}
if ((_track->monitoring_state () & MonitoringDisk) || collect_playback) {
-
+
/* we're doing playback */
framecnt_t necessary_samples;
@@ -656,7 +656,7 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
memcpy ((char *) chaninfo->playback_wrap_buffer,
chaninfo->playback_vector.buf[0],
chaninfo->playback_vector.len[0] * sizeof (Sample));
-
+
/* Copy buf[1] from playback_buf */
memcpy (chaninfo->playback_wrap_buffer + chaninfo->playback_vector.len[0],
chaninfo->playback_vector.buf[1],
@@ -675,13 +675,13 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
int channel = 0;
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) {
ChannelInfo* chaninfo (*chan);
-
+
playback_distance = interpolation.interpolate (
channel, nframes, chaninfo->current_playback_buffer, chaninfo->speed_buffer);
-
+
chaninfo->current_playback_buffer = chaninfo->speed_buffer;
}
-
+
} else {
playback_distance = nframes;
}
@@ -692,20 +692,20 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
if (need_disk_signal) {
/* copy data over to buffer set */
-
+
size_t n_buffers = bufs.count().n_audio();
size_t n_chans = c->size();
gain_t scaling = 1.0f;
-
+
if (n_chans > n_buffers) {
scaling = ((float) n_buffers)/n_chans;
}
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
-
+
AudioBuffer& buf (bufs.get_audio (n%n_buffers));
ChannelInfo* chaninfo (*chan);
-
+
if (n < n_chans) {
if (scaling != 1.0f) {
buf.read_from_with_gain (chaninfo->current_playback_buffer, nframes, scaling);
@@ -725,7 +725,7 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
ChanCount cnt (DataType::AUDIO, n_chans);
cnt.set (DataType::MIDI, bufs.count().n_midi());
bufs.set_count (cnt);
-
+
/* extra buffers will already be silent, so leave them alone */
}
@@ -1124,11 +1124,11 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer, framecn
/* do not read from disk while session is marked as Loading, to avoid
useless redundant I/O.
*/
-
+
if (_session.state_of_the_state() & Session::Loading) {
return 0;
}
-
+
if (c->empty()) {
return 0;
}
@@ -1263,14 +1263,14 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer, framecn
/* now back to samples */
framecnt_t samples_to_read = byte_size_for_read / (bits_per_sample / 8);
-
+
//cerr << name() << " will read " << byte_size_for_read << " out of total bytes " << total_bytes << " in buffer of "
// << c->front()->playback_buf->bufsize() * bits_per_sample / 8 << " bps = " << bits_per_sample << endl;
// cerr << name () << " read samples = " << samples_to_read << " out of total space " << total_space << " in buffer of " << c->front()->playback_buf->bufsize() << " samples\n";
// uint64_t before = g_get_monotonic_time ();
// uint64_t elapsed;
-
+
for (chan_n = 0, i = c->begin(); i != c->end(); ++i, ++chan_n) {
ChannelInfo* chan (*i);
@@ -1352,14 +1352,14 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer, framecn
// elapsed = g_get_monotonic_time () - before;
// cerr << "\tbandwidth = " << (byte_size_for_read / 1048576.0) / (elapsed/1000000.0) << "MB/sec\n";
-
+
file_frame = file_frame_tmp;
assert (file_frame >= 0);
ret = ((total_space - samples_to_read) > disk_read_chunk_frames);
-
+
c->front()->playback_buf->get_write_vector (&vector);
-
+
out:
return ret;
}
@@ -1630,7 +1630,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
}
_last_capture_sources.insert (_last_capture_sources.end(), srcs.begin(), srcs.end());
-
+
_playlist->clear_changes ();
_playlist->set_capture_insertion_in_progress (true);
_playlist->freeze ();
@@ -1774,7 +1774,7 @@ AudioDiskstream::finish_capture (boost::shared_ptr<ChannelList> c)
*/
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose ("Finish capture, add new CI, %1 + %2\n", ci->start, ci->frames));
-
+
capture_info.push_back (ci);
capture_captured = 0;
@@ -1816,25 +1816,25 @@ AudioDiskstream::set_record_safe (bool yn)
if (!recordable() || !_session.record_enabling_legal() || _io->n_ports().n_audio() == 0) {
return;
}
-
+
/* can't rec-safe in destructive mode if transport is before start ????
REQUIRES REVIEW */
-
+
if (destructive() && yn && _session.transport_frame() < _session.current_start_frame()) {
return;
}
-
+
/* yes, i know that this not proof against race conditions, but its
good enough. i think.
*/
-
+
if (record_safe () != yn) {
if (yn) {
engage_record_safe ();
} else {
disengage_record_safe ();
}
-
+
RecordSafeChanged (); /* EMIT SIGNAL */
}
}
@@ -2334,11 +2334,11 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
boost::shared_ptr<AudioRegion> wf_region;
boost::shared_ptr<AudioRegion> region;
-
+
/* First create the whole file region */
PropertyList plist;
-
+
plist.add (Properties::start, 0);
plist.add (Properties::length, first_fs->length (first_fs->timeline_position()));
plist.add (Properties::name, region_name_from_path (first_fs->name(), true));
@@ -2353,7 +2353,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
* the playlist */
region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist));
-
+
_playlist->add_region (region, position);
}
@@ -2414,7 +2414,7 @@ AudioDiskstream::can_become_destructive (bool& requires_bounce) const
if (Profile->get_trx()) {
return false;
}
-
+
if (!_playlist) {
requires_bounce = false;
return false;
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index 06d5f476a1..0553206367 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -152,7 +152,7 @@ struct ReadSorter {
/** A segment of region that needs to be read */
struct Segment {
Segment (boost::shared_ptr<AudioRegion> r, Evoral::Range<framepos_t> a) : region (r), range (a) {}
-
+
boost::shared_ptr<AudioRegion> region; ///< the region
Evoral::Range<framepos_t> range; ///< range of the region to read, in session frames
};
@@ -493,7 +493,7 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version)
if (!string_is_affirmative (p->value())) {
continue;
}
-
+
if ((p = (*i)->property (X_("in"))) == 0) {
continue;
}
@@ -537,7 +537,7 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version)
*/
const XMLNodeList c = (*i)->children ();
-
+
for (XMLNodeConstIterator j = c.begin(); j != c.end(); ++j) {
if ((*j)->name() == X_("FadeOut")) {
out_a->fade_out()->set_state (**j, version);
@@ -545,7 +545,7 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version)
out_a->inverse_fade_out()->set_state (**j, version);
}
}
-
+
out_a->set_fade_out_active (true);
} else {
@@ -555,7 +555,7 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version)
*/
const XMLNodeList c = (*i)->children ();
-
+
for (XMLNodeConstIterator j = c.begin(); j != c.end(); ++j) {
if ((*j)->name() == X_("FadeIn")) {
in_a->fade_in()->set_state (**j, version);
@@ -563,7 +563,7 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version)
in_a->inverse_fade_in()->set_state (**j, version);
}
}
-
+
in_a->set_fade_in_active (true);
}
}
diff --git a/libs/ardour/audio_playlist_importer.cc b/libs/ardour/audio_playlist_importer.cc
index 08cd090cdb..5390f1c9d4 100644
--- a/libs/ardour/audio_playlist_importer.cc
+++ b/libs/ardour/audio_playlist_importer.cc
@@ -177,7 +177,7 @@ AudioPlaylistImporter::_prepare_move ()
}
name = rename_pair.second;
}
-
+
XMLProperty* p = xml_playlist.property ("name");
if (!p) {
error << _("badly-formed XML in imported playlist") << endmsg;
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index 4f414ac2fd..99115d5d6f 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -355,7 +355,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
int dret;
framecnt_t playback_distance;
-
+
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
@@ -386,7 +386,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
BufferSet& bufs = _session.get_route_buffers (n_process_buffers ());
fill_buffers_with_input (bufs, _input, nframes);
-
+
if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->run (bufs, start_frame, end_frame, nframes, true);
}
@@ -486,7 +486,7 @@ AudioTrack::bounceable (boost::shared_ptr<Processor> endpoint, bool include_endp
/* does the output from the last considered processor match the
* input to this one?
*/
-
+
if (naudio != (*r)->input_streams().n_audio()) {
return false;
}
@@ -591,7 +591,7 @@ AudioTrack::freeze_me (InterThreadInfo& itt)
(*r)->deactivate ();
}
}
-
+
_session.set_dirty ();
}
}
diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc
index cf9a25962c..43a40101cf 100644
--- a/libs/ardour/audio_track_importer.cc
+++ b/libs/ardour/audio_track_importer.cc
@@ -247,7 +247,7 @@ AudioTrackImporter::_prepare_move ()
}
name = rename_pair.second;
}
-
+
XMLNode* c = xml_track.child ("IO");
if (!c) {
error << _("badly-formed XML in imported track") << endmsg;
@@ -259,9 +259,9 @@ AudioTrackImporter::_prepare_move ()
error << _("badly-formed XML in imported track") << endmsg;
return false;
}
-
+
p->set_value (name);
-
+
track_handler.add_name (name);
return true;
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index 9f91d3f9bd..485e4ef56a 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -471,7 +471,7 @@ AUPlugin::~AUPlugin ()
AUListenerDispose (_parameter_listener);
_parameter_listener = 0;
}
-
+
if (unit) {
DEBUG_TRACE (DEBUG::AudioUnits, "about to call uninitialize in plugin destructor\n");
unit->Uninitialize ();
@@ -569,12 +569,12 @@ AUPlugin::init ()
if (input_elements > 0) {
/* setup render callback: the plugin calls this to get input data
*/
-
+
AURenderCallbackStruct renderCallbackInfo;
-
+
renderCallbackInfo.inputProc = _render_callback;
renderCallbackInfo.inputProcRefCon = this;
-
+
DEBUG_TRACE (DEBUG::AudioUnits, "set render callback in input scope\n");
if ((err = unit->SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
0, (void*) &renderCallbackInfo, sizeof(renderCallbackInfo))) != 0) {
@@ -1062,7 +1062,7 @@ AUPlugin::configure_io (ChanCount in, ChanCount out)
}
/* reset plugin info to show currently configured state */
-
+
_info->n_inputs = in;
_info->n_outputs = out;
@@ -1495,14 +1495,14 @@ AUPlugin::connect_and_run (BufferSet& bufs, ChanMapping in_map, ChanMapping out_
uint32_t nmidi = bufs.count().n_midi();
for (uint32_t i = 0; i < nmidi; ++i) {
-
+
/* one MIDI port/buffer only */
-
+
MidiBuffer& m = bufs.get_midi (i);
-
+
for (MidiBuffer::iterator i = m.begin(); i != m.end(); ++i) {
Evoral::MIDIEvent<framepos_t> ev (*i);
-
+
if (ev.is_channel_event()) {
const uint8_t* b = ev.buffer();
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1: MIDI event %2\n", name(), ev));
@@ -2550,7 +2550,7 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
int32_t possible_in = info->cache.io_configs.front().first;
int32_t possible_out = info->cache.io_configs.front().second;
-
+
if (possible_in > 0) {
info->n_inputs.set (DataType::AUDIO, possible_in);
} else {
@@ -2917,7 +2917,7 @@ void
AUPlugin::set_info (PluginInfoPtr info)
{
Plugin::set_info (info);
-
+
AUPluginInfoPtr pinfo = boost::dynamic_pointer_cast<AUPluginInfo>(get_info());
_has_midi_input = pinfo->needs_midi_input ();
_has_midi_output = false;
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 50284128de..c5566e1630 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -121,7 +121,7 @@ AudioEngine::create ()
}
_instance = new AudioEngine ();
-
+
return _instance;
}
@@ -158,7 +158,7 @@ AudioEngine::sample_rate_change (pframes_t nframes)
#ifdef SILENCE_AFTER_SECONDS
_silence_countdown = nframes * SILENCE_AFTER_SECONDS;
#endif
-
+
return 0;
}
@@ -219,11 +219,11 @@ AudioEngine::process_callback (pframes_t nframes)
if (_measuring_latency == MeasureAudio && _mtdm) {
/* run a normal cycle from the perspective of the PortManager
so that we get silence on all registered ports.
-
+
we overwrite the silence on the two ports used for latency
measurement.
*/
-
+
PortManager::cycle_start (nframes);
PortManager::silence (nframes);
@@ -262,7 +262,7 @@ AudioEngine::process_callback (pframes_t nframes)
return_after_remove_check = true;
} else if (_latency_flush_frames) {
-
+
/* wait for the appropriate duration for the MTDM signal to
* drain from the ports before we revert to normal behaviour.
*/
@@ -270,7 +270,7 @@ AudioEngine::process_callback (pframes_t nframes)
PortManager::cycle_start (nframes);
PortManager::silence (nframes);
PortManager::cycle_end (nframes);
-
+
if (_latency_flush_frames > nframes) {
_latency_flush_frames -= nframes;
} else {
@@ -294,7 +294,7 @@ AudioEngine::process_callback (pframes_t nframes)
} else if (session_removal_countdown > 0) {
/* we'll be fading audio out.
-
+
if this is the last time we do this as part
of session removal, do a MIDI panic now
to get MIDI stopped. This relies on the fact
@@ -362,7 +362,7 @@ AudioEngine::process_callback (pframes_t nframes)
}
if (last_monitor_check + monitor_check_interval < next_processed_frames) {
-
+
PortManager::check_monitoring ();
last_monitor_check = next_processed_frames;
}
@@ -370,7 +370,7 @@ AudioEngine::process_callback (pframes_t nframes)
#ifdef SILENCE_AFTER_SECONDS
bool was_silent = (_silence_countdown == 0);
-
+
if (_silence_countdown >= nframes) {
_silence_countdown -= nframes;
} else {
@@ -385,17 +385,17 @@ AudioEngine::process_callback (pframes_t nframes)
if (_silence_countdown == 0 || _session->silent()) {
PortManager::silence (nframes);
}
-
-#else
+
+#else
if (_session->silent()) {
PortManager::silence (nframes);
}
#endif
-
+
if (session_remove_pending && session_removal_countdown) {
PortManager::fade_out (session_removal_gain, session_removal_gain_step, nframes);
-
+
if (session_removal_countdown > nframes) {
session_removal_countdown -= nframes;
} else {
@@ -410,7 +410,7 @@ AudioEngine::process_callback (pframes_t nframes)
_processed_frames = next_processed_frames;
PT_TIMING_CHECK (2);
-
+
return 0;
}
@@ -462,12 +462,12 @@ AudioEngine::do_reset_backend()
while (!_stop_hw_reset_processing) {
if (g_atomic_int_get (&_hw_reset_request_count) != 0 && _backend) {
-
+
_reset_request_lock.unlock();
-
+
Glib::Threads::RecMutex::Lock pl (_state_lock);
g_atomic_int_dec_and_test (&_hw_reset_request_count);
-
+
std::cout << "AudioEngine::RESET::Reset request processing. Requests left: " << _hw_reset_request_count << std::endl;
DeviceResetStarted(); // notify about device reset to be started
@@ -478,9 +478,9 @@ AudioEngine::do_reset_backend()
if ( ( 0 == stop () ) &&
( 0 == _backend->reset_device () ) &&
( 0 == start () ) ) {
-
+
std::cout << "AudioEngine::RESET::Engine started..." << std::endl;
-
+
// inform about possible changes
BufferSizeChanged (_backend->buffer_size() );
DeviceResetFinished(); // notify about device reset finish
@@ -491,7 +491,7 @@ AudioEngine::do_reset_backend()
// we've got an error
DeviceError();
}
-
+
std::cout << "AudioEngine::RESET::Done." << std::endl;
_reset_request_lock.lock();
@@ -574,7 +574,7 @@ AudioEngine::stop_hw_event_processing()
_hw_devicelist_update_thread->join ();
_hw_devicelist_update_thread = 0;
}
-
+
}
@@ -633,7 +633,7 @@ AudioEngine::reconnect_session_routes (bool reconnect_inputs, bool reconnect_out
if (_session) {
_session->reconnect_existing_routes(true, true, reconnect_inputs, reconnect_outputs);
}
-#endif
+#endif
}
@@ -733,13 +733,13 @@ AudioEngine::backend_discover (const string& path)
Glib::Module::get_last_error()) << endmsg;
return 0;
}
-
+
if (!module.get_symbol ("descriptor", func)) {
error << string_compose(_("AudioEngine: backend at \"%1\" has no descriptor function."), path) << endmsg;
error << Glib::Module::get_last_error() << endmsg;
return 0;
}
-
+
dfunc = (AudioBackendInfo* (*)(void))func;
info = dfunc();
if (!info->available()) {
@@ -747,7 +747,7 @@ AudioEngine::backend_discover (const string& path)
}
module.make_resident ();
-
+
return info;
}
@@ -755,7 +755,7 @@ vector<const AudioBackendInfo*>
AudioEngine::available_backends() const
{
vector<const AudioBackendInfo*> r;
-
+
for (BackendMap::const_iterator i = _backends.begin(); i != _backends.end(); ++i) {
r.push_back (i->second);
}
@@ -805,12 +805,12 @@ AudioEngine::set_backend (const std::string& name, const std::string& arg1, cons
}
drop_backend ();
-
+
try {
if (b->second->instantiate (arg1, arg2)) {
throw failed_constructor ();
}
-
+
_backend = b->second->factory (*this);
} catch (exception& e) {
@@ -846,20 +846,20 @@ AudioEngine::start (bool for_latency)
}
_running = true;
-
+
if (_session) {
_session->set_frame_rate (_backend->sample_rate());
-
+
if (_session->config.get_jack_time_master()) {
_backend->set_time_master (true);
}
}
-
+
if (!for_latency) {
Running(); /* EMIT SIGNAL */
}
-
+
return 0;
}
@@ -898,13 +898,13 @@ AudioEngine::stop (bool for_latency)
_latency_output_port = 0;
_latency_input_port = 0;
_started_for_latency = false;
-
+
Port::PortDrop ();
if (!for_latency) {
Stopped (); /* EMIT SIGNAL */
}
-
+
return 0;
}
@@ -1264,7 +1264,7 @@ AudioEngine::setup_required () const
return false;
}
}
-
+
return true;
}
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index 722d6acc17..257d396fb8 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -343,4 +343,4 @@ AudioFileSource::get_interleave_buffer (framecnt_t size)
return ssb->buf;
}
-
+
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 361b463450..8f5228ad6a 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -131,13 +131,13 @@ merge_curves (boost::shared_ptr<Evoral::ControlList> dst,
if (size != curve2->size()) {
return;
}
-
+
Evoral::ControlList::const_iterator c1 = curve1->begin();
int count = 0;
for (Evoral::ControlList::const_iterator c2 = curve2->begin(); c2!=curve2->end(); c2++ ) {
float v1 = accurate_coefficient_to_dB((*c1)->value);
float v2 = accurate_coefficient_to_dB((*c2)->value);
-
+
double interp = v1 * ( 1.0-( (double)count / (double)size) );
interp += v2 * ( (double)count / (double)size );
@@ -491,7 +491,7 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
*/
assert (cnt >= 0);
-
+
if (n_channels() == 0) {
return 0;
}
@@ -521,29 +521,29 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
of any fade out that we are dealing with
*/
frameoffset_t fade_out_offset = 0;
-
+
/* Amount (length) of fade out that we are dealing with in this read */
framecnt_t fade_out_limit = 0;
framecnt_t fade_interval_start = 0;
/* Fade in */
-
+
if (_fade_in_active && _session.config.get_use_region_fades()) {
-
+
framecnt_t fade_in_length = (framecnt_t) _fade_in->back()->when;
/* see if this read is within the fade in */
-
+
if (internal_offset < fade_in_length) {
fade_in_limit = min (to_read, fade_in_length - internal_offset);
}
}
-
+
/* Fade out */
-
+
if (_fade_out_active && _session.config.get_use_region_fades()) {
-
+
/* see if some part of this read is within the fade out */
/* ................. >| REGION
@@ -565,7 +565,7 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
fade_interval_start = max (internal_offset, _length - framecnt_t (_fade_out->back()->when));
framecnt_t fade_interval_end = min(internal_offset + to_read, _length.val());
-
+
if (fade_interval_end > fade_interval_start) {
/* (part of the) the fade out is in this buffer */
fade_out_limit = fade_interval_end - fade_interval_start;
@@ -616,26 +616,26 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
/* explicit inverse fade in curve (e.g. for constant
* power), so we have to fetch it.
*/
-
+
_inverse_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
-
+
/* Fade the data from lower layers out */
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] *= gain_buffer[n];
}
-
+
/* refill gain buffer with the fade in */
-
+
_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
-
+
} else {
-
+
/* no explicit inverse fade in, so just use (1 - fade
* in) for the fade out of lower layers
*/
-
+
_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
-
+
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] *= 1 - gain_buffer[n];
}
@@ -656,27 +656,27 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
if (opaque()) {
if (_inverse_fade_out) {
-
+
_inverse_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
-
+
/* Fade the data from lower levels in */
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] *= gain_buffer[n];
}
-
+
/* fetch the actual fade out */
_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
-
+
} else {
/* no explicit inverse fade out (which is
* actually a fade in), so just use (1 - fade
* out) for the fade in of lower layers
*/
-
+
_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
-
+
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] *= 1 - gain_buffer[n];
}
@@ -692,7 +692,7 @@ AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
buf[m] += mixdown_buffer[m] * gain_buffer[n];
}
}
-
+
/* MIX OR COPY THE REGION BODY FROM mixdown_buffer INTO buf */
framecnt_t const N = to_read - fade_in_limit - fade_out_limit;
@@ -733,7 +733,7 @@ AudioRegion::read_from_sources (SourceList const & srcs, framecnt_t limit, Sampl
if (to_read == 0) {
return 0;
}
-
+
if (chan_n < n_channels()) {
boost::shared_ptr<AudioSource> src = boost::dynamic_pointer_cast<AudioSource> (srcs[chan_n]);
@@ -759,7 +759,7 @@ AudioRegion::read_from_sources (SourceList const & srcs, framecnt_t limit, Sampl
}
} else {
-
+
/* use silence */
memset (buf, 0, sizeof (Sample) * to_read);
}
@@ -921,7 +921,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
_fade_out->set_state (*grandchild, version);
}
}
-
+
if ((prop = child->property ("active")) != 0) {
if (string_is_affirmative (prop->value())) {
set_fade_out_active (true);
@@ -929,7 +929,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
set_fade_out_active (false);
}
}
-
+
} else if ( (child->name() == "InverseFadeIn") || (child->name() == "InvFadeIn") ) {
XMLNode* grandchild = child->child ("AutomationList");
if (grandchild) {
@@ -1063,7 +1063,7 @@ AudioRegion::set_fade_in (FadeShape shape, framecnt_t len)
_fade_in->fast_simple_add (len, GAIN_COEFF_UNITY);
reverse_curve (_inverse_fade_in.val(), _fade_in.val());
break;
-
+
case FadeSymmetric:
//start with a nearly linear cuve
_fade_in->fast_simple_add (0, 1);
@@ -1119,12 +1119,12 @@ AudioRegion::set_fade_out (FadeShape shape, framecnt_t len)
_fade_out->fast_simple_add (len, GAIN_COEFF_SMALL);
reverse_curve (_inverse_fade_out.val(), _fade_out.val());
break;
-
+
case FadeFast:
generate_db_fade (_fade_out.val(), len, num_steps, -60);
generate_inverse_power_curve (_inverse_fade_out.val(), _fade_out.val());
break;
-
+
case FadeSlow:
generate_db_fade (c1, len, num_steps, -1); //start off with a slow fade
generate_db_fade (c2, len, num_steps, -80); //end with a fast fade
@@ -1143,7 +1143,7 @@ AudioRegion::set_fade_out (FadeShape shape, framecnt_t len)
_fade_out->fast_simple_add (len, GAIN_COEFF_SMALL);
reverse_curve (_inverse_fade_out.val(), _fade_out.val());
break;
-
+
case FadeSymmetric:
//start with a nearly linear cuve
_fade_out->fast_simple_add (0, 1);
@@ -1173,7 +1173,7 @@ AudioRegion::set_fade_in_length (framecnt_t len)
if (len > _length) {
len = _length - 1;
}
-
+
if (len < 64) {
len = 64;
}
@@ -1204,7 +1204,7 @@ AudioRegion::set_fade_out_length (framecnt_t len)
bool changed = _fade_out->extend_to (len);
if (changed) {
-
+
if (_inverse_fade_out) {
_inverse_fade_out->extend_to (len);
}
@@ -1893,7 +1893,7 @@ AudioRegion::get_single_other_xfade_region (bool start) const
} else {
rl = pl->regions_at (last_frame());
}
-
+
RegionList::iterator i;
boost::shared_ptr<Region> other;
uint32_t n = 0;
@@ -1946,6 +1946,6 @@ AudioRegion::verify_xfade_bounds (framecnt_t len, bool start)
}
return min (length(), min (maxlen, len));
-
+
}
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index 89e1e0593b..9c4c49e737 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -317,7 +317,7 @@ framecnt_t
AudioSource::read (Sample *dst, framepos_t start, framecnt_t cnt, int /*channel*/) const
{
assert (cnt >= 0);
-
+
Glib::Threads::Mutex::Lock lm (_lock);
return read_unlocked (dst, start, cnt);
}
@@ -370,7 +370,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t
}
if (!_captured_for.empty()) {
-
+
/* _captured_for is only set after a capture pass is
* complete. so we know that capturing is finished for this
* file, and now we can check actual size of the peakfile is at
@@ -382,9 +382,9 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t
* might decided to get rid of that anyway.
*
*/
-
+
const off_t expected_file_size = (_length / (double) samples_per_file_peak) * sizeof (PeakData);
-
+
if (statbuf.st_size < expected_file_size) {
warning << string_compose (_("peak file %1 is truncated from %2 to %3"), _peakpath, expected_file_size, statbuf.st_size) << endmsg;
const_cast<AudioSource*>(this)->build_peaks_from_scratch ();
@@ -404,7 +404,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t
error << string_compose (_("Cannot open peakfile @ %1 for reading (%2)"), _peakpath, strerror (errno)) << endmsg;
return -1;
}
-
+
scale = npeaks/expected_peaks;
@@ -728,7 +728,7 @@ AudioSource::build_peaks_from_scratch ()
/* hold lock while building peaks */
Glib::Threads::Mutex::Lock lp (_lock);
-
+
if (prepare_for_peakfile_writes ()) {
goto out;
}
@@ -743,7 +743,7 @@ AudioSource::build_peaks_from_scratch ()
framecnt_t frames_to_read = min (bufsize, cnt);
framecnt_t frames_read;
-
+
if ((frames_read = read_unlocked (buf.get(), current_frame, frames_to_read)) != frames_to_read) {
error << string_compose(_("%1: could not write read raw data for peak computation (%2)"), _name, strerror (errno)) << endmsg;
done_with_peakfile_writes (false);
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index 27d56d7e1b..fe84a2d717 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -165,20 +165,20 @@ Auditioner::connect ()
/* create (and connect) new ports */
_main_outs->defer_pan_reset ();
-
+
if (left.length()) {
_output->add_port (left, this, DataType::AUDIO);
}
-
+
if (right.length()) {
_output->add_port (right, this, DataType::AUDIO);
}
-
+
_main_outs->allow_pan_reset ();
_main_outs->reset_panner ();
} else {
-
+
/* reconnect existing ports */
boost::shared_ptr<Port> oleft (_output->nth (0));
@@ -190,7 +190,7 @@ Auditioner::connect ()
oright->connect (right);
}
}
-
+
}
return 0;
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index f928ee01b3..a2ce81acca 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -66,7 +66,7 @@ Automatable::~Automatable ()
{
{
Glib::Threads::Mutex::Lock lm (_control_lock);
-
+
for (Controls::const_iterator li = _controls.begin(); li != _controls.end(); ++li) {
boost::dynamic_pointer_cast<AutomationControl>(li->second)->drop_references ();
}
@@ -288,7 +288,7 @@ Automatable::get_parameter_automation_state (Evoral::Parameter param)
AutoState result = Off;
boost::shared_ptr<AutomationControl> c = automation_control(param);
-
+
if (c) {
result = c->automation_state();
}
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index 3cf3d6af8b..91609f6acb 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -224,7 +224,7 @@ AutomationList::stop_touch (bool mark, double)
if (_state == Touch) {
if (mark) {
-
+
/* XXX need to mark the last added point with the
* current time
*/
@@ -520,4 +520,4 @@ AutomationListProperty::clone () const
boost::shared_ptr<AutomationList> (new AutomationList (*this->_current.get()))
);
}
-
+
diff --git a/libs/ardour/automation_watch.cc b/libs/ardour/automation_watch.cc
index e9fecb5973..6ebf1aab71 100644
--- a/libs/ardour/automation_watch.cc
+++ b/libs/ardour/automation_watch.cc
@@ -47,7 +47,7 @@ AutomationWatch::AutomationWatch ()
, _last_time (0)
, _run_thread (false)
{
-
+
}
AutomationWatch::~AutomationWatch ()
@@ -85,7 +85,7 @@ AutomationWatch::add_automation_watch (boost::shared_ptr<AutomationControl> ac)
* creates reference cycles. we don't need to make the weak_ptr<>
* explicit here, but it helps to remind us what is going on.
*/
-
+
boost::weak_ptr<AutomationControl> wac (ac);
ac->DropReferences.connect_same_thread (*this, boost::bind (&AutomationWatch::remove_weak_automation_watch, this, wac));
}
@@ -139,7 +139,7 @@ AutomationWatch::timer ()
}
}
}
-
+
_last_time = time;
}
@@ -171,7 +171,7 @@ AutomationWatch::set_session (Session* s)
if (_session) {
_run_thread = true;
_thread = Glib::Threads::Thread::create (boost::bind (&AutomationWatch::thread, this));
-
+
_session->TransportStateChange.connect_same_thread (transport_connection, boost::bind (&AutomationWatch::transport_state_change, this));
}
}
@@ -184,7 +184,7 @@ AutomationWatch::transport_state_change ()
}
bool rolling = _session->transport_rolling();
-
+
_last_time = _session->audible_frame ();
{
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc
index 82e96be750..92f5272b3b 100644
--- a/libs/ardour/buffer_set.cc
+++ b/libs/ardour/buffer_set.cc
@@ -187,7 +187,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
for (size_t i = 0; i < num_buffers; ++i) {
bufs.push_back(Buffer::create(type, buffer_capacity));
}
-
+
_available.set(type, num_buffers);
_count.set (type, num_buffers);
}
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index 7e50807c6e..99340839d2 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -568,7 +568,7 @@ Bundle::type_channel_to_overall (DataType t, uint32_t c) const
if (t == DataType::NIL) {
return c;
}
-
+
Glib::Threads::Mutex::Lock lm (_channel_mutex);
vector<Channel>::const_iterator i = _channel.begin ();
@@ -602,11 +602,11 @@ Bundle::overall_channel_to_type (DataType t, uint32_t c) const
if (t == DataType::NIL) {
return c;
}
-
+
Glib::Threads::Mutex::Lock lm (_channel_mutex);
uint32_t s = 0;
-
+
vector<Channel>::const_iterator i = _channel.begin ();
for (uint32_t j = 0; j < c; ++j) {
if (i->type == t) {
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc
index 272612f7b5..62f3a525ea 100644
--- a/libs/ardour/butler.cc
+++ b/libs/ardour/butler.cc
@@ -106,7 +106,7 @@ Butler::start_thread()
{
// set up capture and playback buffering
Diskstream::set_buffering_parameters (Config->get_buffering_preset());
-
+
/* size is in Samples, not bytes */
const float rate = (float)_session.frame_rate();
audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * rate);
@@ -133,7 +133,7 @@ Butler::start_thread()
// we are ready to request buffer adjustments
_session.adjust_capture_buffering ();
_session.adjust_playback_buffering ();
-
+
return 0;
}
@@ -198,7 +198,7 @@ Butler::thread_work ()
}
}
-
+
restart:
DEBUG_TRACE (DEBUG::Butler, "at restart for disk work\n");
disk_work_outstanding = false;
@@ -244,7 +244,7 @@ Butler::thread_work ()
case 0:
DEBUG_TRACE (DEBUG::Butler, string_compose ("\ttrack refill done %1\n", tr->name()));
break;
-
+
case 1:
DEBUG_TRACE (DEBUG::Butler, string_compose ("\ttrack refill unfinished %1\n", tr->name()));
disk_work_outstanding = true;
@@ -315,7 +315,7 @@ Butler::flush_tracks_to_disk_normal (boost::shared_ptr<RouteList> rl, uint32_t&
for (RouteList::iterator i = rl->begin(); !transport_work_requested() && should_run && i != rl->end(); ++i) {
// cerr << "write behind for " << (*i)->name () << endl;
-
+
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
if (!tr) {
@@ -350,7 +350,7 @@ Butler::flush_tracks_to_disk_normal (boost::shared_ptr<RouteList> rl, uint32_t&
}
return disk_work_outstanding;
-}
+}
bool
Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr<RouteList> rl, uint32_t& errors)
@@ -360,7 +360,7 @@ Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr<RouteList> rl, uint
/* almost the same as the "normal" version except that we do not test
* for transport_work_requested() and we force flushes.
*/
-
+
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
// cerr << "write behind for " << (*i)->name () << endl;
@@ -399,7 +399,7 @@ Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr<RouteList> rl, uint
}
return disk_work_outstanding;
-}
+}
void
Butler::schedule_transport_work ()
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index 8b137843dd..4e2cb7d9f7 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -113,7 +113,7 @@ ControlProtocolManager::activate (ControlProtocolInfo& cpi)
cp->set_active (true);
return 0;
-}
+}
int
ControlProtocolManager::deactivate (ControlProtocolInfo& cpi)
@@ -137,15 +137,15 @@ ControlProtocolManager::drop_protocols ()
/* called explicitly by Session::destroy() so that we can clean up
* before the process cycle stops and ports vanish.
*/
-
+
Glib::Threads::Mutex::Lock lm (protocols_lock);
-
+
for (list<ControlProtocol*>::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) {
delete *p;
}
-
+
control_protocols.clear ();
-
+
for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) {
// mark existing protocols as requested
// otherwise the ControlProtocol instances are not recreated in set_session
@@ -154,7 +154,7 @@ ControlProtocolManager::drop_protocols ()
(*p)->protocol = 0;
}
}
-}
+}
ControlProtocol*
ControlProtocolManager::instantiate (ControlProtocolInfo& cpi)
@@ -202,7 +202,7 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
if (cpi.mandatory) {
return 0;
}
-
+
/* save current state */
delete cpi.state;
@@ -288,7 +288,7 @@ ControlProtocolManager::discover_control_protocols ()
DEBUG_TRACE (DEBUG::ControlProtocols,
string_compose (_("looking for control protocols in %1\n"), control_protocol_search_path().to_string()));
-
+
for (vector<std::string>::iterator i = cp_modules.begin(); i != cp_modules.end(); ++i) {
control_protocol_discover (*i);
}
@@ -409,16 +409,16 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/)
}
bool active = string_is_affirmative (prop->value());
-
+
if ((prop = (*citer)->property (X_("name"))) == 0) {
continue;
}
ControlProtocolInfo* cpi = cpi_by_name (prop->value());
-
+
if (cpi) {
cpi->state = new XMLNode (**citer);
-
+
if (active) {
if (_session) {
instantiate (*cpi);
diff --git a/libs/ardour/cycle_timer.cc b/libs/ardour/cycle_timer.cc
index 84dafd00cc..ad91fa6874 100644
--- a/libs/ardour/cycle_timer.cc
+++ b/libs/ardour/cycle_timer.cc
@@ -85,7 +85,7 @@ StoringTimer::StoringTimer (int N)
_max_points = N;
_points = 0;
}
-
+
void
StoringTimer::dump (string const & file)
@@ -114,11 +114,11 @@ StoringTimer::check (int p)
} else if (_points > _max_points) {
return;
}
-
+
_point[_points] = p;
_value[_points] = get_cycles ();
_ref[_points] = _current_ref;
-
+
++_points;
}
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc
index 7bccf3121d..b70d86a75d 100644
--- a/libs/ardour/delivery.cc
+++ b/libs/ardour/delivery.cc
@@ -97,7 +97,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<Pannable> pannable, boost::sha
Delivery::~Delivery()
{
- DEBUG_TRACE (DEBUG::Destruction, string_compose ("delivery %1 destructor\n", _name));
+ DEBUG_TRACE (DEBUG::Destruction, string_compose ("delivery %1 destructor\n", _name));
/* this object should vanish from any signal callback lists
that it is on before we get any further. The full qualification
@@ -462,7 +462,7 @@ Delivery::flush_buffers (framecnt_t nframes)
if (!_output) {
return;
}
-
+
PortSet& ports (_output->ports());
for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index f2da7982fe..c0ed359bdd 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -504,7 +504,7 @@ Diskstream::set_state (const XMLNode& node, int /*version*/)
error << string_compose (_("%1: this session uses destructive tracks, which are not supported"), PROGRAM_NAME) << endmsg;
return -1;
}
-
+
if ((prop = node.property (X_("capture-alignment"))) != 0) {
set_align_choice (AlignChoice (string_2_enum (prop->value(), _alignment_choice)), true);
} else {
@@ -526,7 +526,7 @@ Diskstream::set_state (const XMLNode& node, int /*version*/)
non_realtime_set_speed ();
}
}
-
+
if ((prop = node.property ("record-safe")) != 0) {
_record_safe = PBD::string_is_affirmative (prop->value()) ? 1 : 0;
}
@@ -799,7 +799,7 @@ framecnt_t
Diskstream::default_disk_read_chunk_frames()
{
return 65536;
-}
+}
framecnt_t
Diskstream::default_disk_write_chunk_frames ()
@@ -818,7 +818,7 @@ Diskstream::set_buffering_parameters (BufferingPreset bp)
if (!get_buffering_presets (bp, read_chunk_size, read_buffer_size, write_chunk_size, write_buffer_size)) {
return;
}
-
+
disk_read_chunk_frames = read_chunk_size;
disk_write_chunk_frames = write_chunk_size;
Config->set_audio_capture_buffer_seconds (write_buffer_size);
diff --git a/libs/ardour/engine_slave.cc b/libs/ardour/engine_slave.cc
index 849b7320d3..8b7c3ba510 100644
--- a/libs/ardour/engine_slave.cc
+++ b/libs/ardour/engine_slave.cc
@@ -62,6 +62,6 @@ Engine_Slave::speed_and_position (double& sp, framepos_t& position)
} else {
_starting = false;
}
-
+
return true;
}
diff --git a/libs/ardour/engine_state_controller.cc b/libs/ardour/engine_state_controller.cc
index 991af4cf4e..57b8a84888 100644
--- a/libs/ardour/engine_state_controller.cc
+++ b/libs/ardour/engine_state_controller.cc
@@ -583,7 +583,7 @@ EngineStateController::_validate_current_device_state ()
// if current is not found switch to default if is supported
if (bs_iter == buffer_sizes.end ()) {
bs_iter = std::find (buffer_sizes.begin (), buffer_sizes.end (), backend->default_buffer_size (_current_state->device_name));
-
+
if (bs_iter != buffer_sizes.end ()) {
_current_state->buffer_size = backend->default_buffer_size (_current_state->device_name);
} else {
@@ -1423,7 +1423,7 @@ EngineStateController::_on_session_loaded ()
// This is done during session construction
// _session->reconnect_ltc_input ();
// _session->reconnect_ltc_output ();
-
+
framecnt_t desired_sample_rate = _session->nominal_frame_rate ();
if ( desired_sample_rate > 0 && set_new_sample_rate_in_controller (desired_sample_rate))
{
@@ -1780,7 +1780,7 @@ bool
EngineStateController::push_current_state_to_backend (bool start)
{
boost::shared_ptr<AudioBackend> backend = AudioEngine::instance ()->current_backend ();
-
+
if (!backend) {
return false;
}
@@ -1820,7 +1820,7 @@ EngineStateController::push_current_state_to_backend (bool start)
if (!result ) {
std::cout << "EngineStateController::Setting device sample rate " << _current_state->sample_rate << std::endl;
result = backend->set_sample_rate (_current_state->sample_rate);
-
+
if (result) {
error << string_compose (_("Cannot set sample rate to %1"), get_current_sample_rate ()) << endmsg;
}
diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc
index f6044aeb08..e681eacbac 100644
--- a/libs/ardour/enums.cc
+++ b/libs/ardour/enums.cc
@@ -405,7 +405,7 @@ setup_enum_writer ()
REGISTER_CLASS_ENUM (SessionEvent, Replace);
REGISTER_CLASS_ENUM (SessionEvent, Clear);
REGISTER (_SessionEvent_Action);
-
+
REGISTER_CLASS_ENUM (Session, Stopped);
REGISTER_CLASS_ENUM (Session, Waiting);
REGISTER_CLASS_ENUM (Session, Running);
diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc
index 8782162304..28f688df81 100644
--- a/libs/ardour/event_type_map.cc
+++ b/libs/ardour/event_type_map.cc
@@ -195,7 +195,7 @@ EventTypeMap::from_symbol(const string& str) const
} else {
PBD::warning << "Unknown Parameter '" << str << "'" << endmsg;
}
-
+
return Evoral::Parameter(p_type, p_channel, p_id);
}
diff --git a/libs/ardour/export_filename.cc b/libs/ardour/export_filename.cc
index 945af25dee..077106a4b0 100644
--- a/libs/ardour/export_filename.cc
+++ b/libs/ardour/export_filename.cc
@@ -128,7 +128,7 @@ ExportFilename::set_state (const XMLNode & node)
folder = tmp;
}
}
-
+
if (folder.empty()) {
folder = session.session_directory().export_path();
}
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc
index 8ef69f2472..c054d85242 100644
--- a/libs/ardour/export_graph_builder.cc
+++ b/libs/ardour/export_graph_builder.cc
@@ -378,7 +378,7 @@ ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpe
config = new_config;
uint32_t const channels = config.channel_config->get_n_chans();
max_frames_out = 4086 - (4086 % channels); // TODO good chunk size
-
+
buffer.reset (new AllocatingProcessContext<Sample> (max_frames_out, channels));
peak_reader.reset (new PeakReader ());
normalizer.reset (new AudioGrapher::Normalizer (config.format->normalize_target()));
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc
index 16aee32a3c..c7dd71040b 100644
--- a/libs/ardour/export_handler.cc
+++ b/libs/ardour/export_handler.cc
@@ -168,7 +168,7 @@ ExportHandler::start_timespan ()
this is the timespan to do this time
*/
current_timespan = config_map.begin()->first;
-
+
export_status->total_frames_current_timespan = current_timespan->get_length();
export_status->timespan_name = current_timespan->name();
export_status->processed_frames_current_timespan = 0;
@@ -564,7 +564,7 @@ ExportHandler::write_cue_header (CDMarkerStatus & status)
BINARY = "header-less" audio (44.1 kHz, 16 Bit, little endian),
MOTOROLA = "header-less" audio (44.1 kHz, 16 Bit, big endian),
and MP3
-
+
We try to use these file types whenever appropriate and
default to our own names otherwise.
*/
@@ -688,14 +688,14 @@ ExportHandler::write_track_info_toc (CDMarkerStatus & status)
status.out << "CD_TEXT {" << endl << " LANGUAGE 0 {" << endl;
status.out << " TITLE " << toc_escape_cdtext (status.marker->name()) << endl;
-
+
status.out << " PERFORMER ";
if (status.marker->cd_info.find("performer") != status.marker->cd_info.end()) {
status.out << toc_escape_cdtext (status.marker->cd_info["performer"]) << endl;
} else {
status.out << "\"\"" << endl;
}
-
+
if (status.marker->cd_info.find("composer") != status.marker->cd_info.end()) {
status.out << " SONGWRITER " << toc_escape_cdtext (status.marker->cd_info["composer"]) << endl;
}
@@ -816,7 +816,7 @@ ExportHandler::toc_escape_cdtext (const std::string& txt)
out += buf;
}
}
-
+
out += '"';
return out;
@@ -841,7 +841,7 @@ ExportHandler::toc_escape_filename (const std::string& txt)
out += *c;
}
}
-
+
out += '"';
return out;
@@ -852,13 +852,13 @@ ExportHandler::cue_escape_cdtext (const std::string& txt)
{
std::string latin1_txt;
std::string out;
-
+
try {
latin1_txt = Glib::convert (txt, "ISO-8859-1", "UTF-8");
} catch (Glib::ConvertError& err) {
throw Glib::ConvertError (err.code(), string_compose (_("Cannot convert %1 to Latin-1 text"), txt));
}
-
+
// does not do much mor than UTF-8 to Latin1 translation yet, but
// that may have to change if cue parsers in burning programs change
out = '"' + latin1_txt + '"';
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc
index a4d6239ae4..e94486bd46 100644
--- a/libs/ardour/export_profile_manager.cc
+++ b/libs/ardour/export_profile_manager.cc
@@ -400,7 +400,7 @@ ExportProfileManager::init_timespans (XMLNodeList nodes)
} else {
session_range = session.locations()->session_range_location();
}
-
+
if (!session_range) { return false; }
ExportTimespanPtr timespan = handler->add_timespan();
@@ -789,7 +789,7 @@ std::string
ExportProfileManager::get_sample_filename_for_format (ExportFilenamePtr filename, ExportFormatSpecPtr format)
{
assert (format);
-
+
if (channel_configs.empty()) { return ""; }
std::list<string> filenames;
@@ -829,7 +829,7 @@ ExportProfileManager::get_warnings ()
if (!channel_configs.empty ()) {
channel_config_state = channel_configs.front();
}
-
+
TimespanStatePtr timespan_state = timespans.front();
/*** Check "global" config ***/
@@ -867,7 +867,7 @@ ExportProfileManager::get_warnings ()
check_config (warnings, timespan_state, channel_config_state, *format_it, *filename_it);
}
}
-
+
return warnings;
}
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index f5c241eaf8..3ec561d667 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -274,7 +274,7 @@ FileSource::find (Session& s, DataType type, const string& path, bool must_exist
vector<string>::iterator j = i;
++j;
-
+
while (j != hits.end()) {
if (PBD::equivalent_paths (*i, *j)) {
/* *i and *j are the same file; break out of the loop early */
@@ -316,10 +316,10 @@ FileSource::find (Session& s, DataType type, const string& path, bool must_exist
} else {
/* only one match: happy days */
-
+
keeppath = de_duped_hits[0];
}
-
+
} else {
keeppath = path;
}
@@ -566,7 +566,7 @@ FileSource::is_stub () const
if (!empty()) {
return false;
}
-
+
if (!removable()) {
return false;
}
@@ -577,7 +577,7 @@ FileSource::is_stub () const
return true;
}
-
+
int
FileSource::rename (const string& newpath)
{
@@ -604,4 +604,4 @@ FileSource::rename (const string& newpath)
return 0;
}
-
+
diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc
index c5cd864590..fcdf42cbbe 100644
--- a/libs/ardour/filesystem_paths.cc
+++ b/libs/ardour/filesystem_paths.cc
@@ -53,14 +53,14 @@ user_config_directory_name (int version = -1)
called, so rely on build-time detection of the
product name etc.
*/
-
+
#ifdef USE_TRACKS_CODE_FEATURES
/* Tracks does not use versioned configuration folders, which may or
may not be problematic in the future.
*/
return X_(PROGRAM_NAME);
-#else
+#else
const string config_dir_name = string_compose ("%1%2", X_(PROGRAM_NAME), version);
#if defined (__APPLE__) || defined (PLATFORM_WINDOWS)
@@ -70,8 +70,8 @@ user_config_directory_name (int version = -1)
/* use lower case folder name on Linux */
return downcase (config_dir_name);
#endif
-#endif
-}
+#endif
+}
std::string
user_config_directory (int version)
@@ -208,7 +208,7 @@ ardour_dll_directory ()
if (s.empty()) {
std::cerr << _("ARDOUR_DLL_PATH not set in environment - exiting\n");
::exit (1);
- }
+ }
return s;
#endif
}
diff --git a/libs/ardour/filter.cc b/libs/ardour/filter.cc
index 382e6d9d86..36a74da0f5 100644
--- a/libs/ardour/filter.cc
+++ b/libs/ardour/filter.cc
@@ -75,19 +75,19 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, s
sample_rate = session.frame_rate();
} else {
boost::shared_ptr<AudioRegion> aregion = boost::dynamic_pointer_cast<AudioRegion>(region);
-
+
if (aregion) {
sample_rate = aregion->audio_source()->sample_rate();
} else {
return -1;
}
}
-
+
nsrcs.push_back (boost::dynamic_pointer_cast<Source> (
SourceFactory::createWritable (region->data_type(), session,
path, false, sample_rate)));
}
-
+
catch (failed_constructor& err) {
error << string_compose (_("filter: error creating new file %1 (%2)"), path, strerror (errno)) << endmsg;
return -1;
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 5ef66c10c2..d9e0602f6c 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -168,15 +168,15 @@ setup_hardware_optimization (bool try_optimization)
#ifdef PLATFORM_WINDOWS
/* We have AVX-optimized code for Windows */
-
+
if (fpu->has_avx()) {
-#else
+#else
/* AVX code doesn't compile on Linux yet */
-
+
if (false) {
-#endif
+#endif
info << "Using AVX optimized routines" << endmsg;
-
+
// AVX SET
compute_peak = x86_sse_avx_compute_peak;
find_peaks = x86_sse_avx_find_peaks;
@@ -287,9 +287,9 @@ copy_configuration_files (string const & old_dir, string const & new_dir, int ol
if (g_mkdir_with_parents (new_dir.c_str(), 0755)) {
return -1;
}
-
+
if (old_version == 3) {
-
+
old_name = Glib::build_filename (old_dir, X_("recent"));
new_name = Glib::build_filename (new_dir, X_("recent"));
@@ -307,7 +307,7 @@ copy_configuration_files (string const & old_dir, string const & new_dir, int ol
* $CONFIG/ardour.rc. Pick up the newer "old" config file,
* to avoid confusion.
*/
-
+
string old_name = Glib::build_filename (old_dir, X_("config"));
if (!Glib::file_test (old_name, Glib::FILE_TEST_EXISTS)) {
@@ -334,7 +334,7 @@ copy_configuration_files (string const & old_dir, string const & new_dir, int ol
old_name = Glib::build_filename (old_dir, X_("presets"));
new_name = Glib::build_filename (new_dir, X_("presets"));
-
+
copy_recurse (old_name, new_name);
/* presets */
@@ -343,12 +343,12 @@ copy_configuration_files (string const & old_dir, string const & new_dir, int ol
new_name = Glib::build_filename (new_dir, X_("plugin_statuses"));
copy_file (old_name, new_name);
-
+
/* export formats */
old_name = Glib::build_filename (old_dir, export_formats_dir_name);
new_name = Glib::build_filename (new_dir, export_formats_dir_name);
-
+
vector<string> export_formats;
g_mkdir_with_parents (Glib::build_filename (new_dir, export_formats_dir_name).c_str(), 0755);
find_files_matching_pattern (export_formats, old_name, X_("*.format"));
@@ -366,7 +366,7 @@ void
ARDOUR::check_for_old_configuration_files ()
{
int current_version = atoi (X_(PROGRAM_VERSION));
-
+
if (current_version <= 1) {
return;
}
@@ -515,7 +515,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
surface support that would list their port names, we do have to
list them here.
*/
-
+
char const * const reserved[] = {
_("Monitor"),
_("Master"),
@@ -528,7 +528,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
for (int n = 0; reserved[n]; ++n) {
reserved_io_names.push_back (reserved[n]);
}
-
+
libardour_initialized = true;
return true;
@@ -612,7 +612,7 @@ void
ARDOUR::setup_fpu ()
{
FPU* fpu = FPU::instance ();
-
+
if (getenv ("ARDOUR_RUNNING_UNDER_VALGRIND")) {
// valgrind doesn't understand this assembler stuff
// September 10th, 2007
@@ -632,7 +632,7 @@ ARDOUR::setup_fpu ()
#ifdef DEBUG_DENORMAL_EXCEPTION
/* This will raise a FP exception if a denormal is detected */
MXCSR &= ~_MM_MASK_DENORM;
-#endif
+#endif
switch (Config->get_denormal_model()) {
case DenormalNone:
@@ -709,15 +709,15 @@ ARDOUR::set_translations_enabled (bool yn)
if (fd < 0) {
return false;
}
-
+
char c;
-
+
if (yn) {
c = '1';
} else {
c = '0';
}
-
+
(void) ::write (fd, &c, 1);
(void) ::close (fd);
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index 8cce0efdbc..ff4f860d68 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -435,7 +435,7 @@ Graph::main_thread()
again:
_callback_start_sem.wait ();
-
+
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread is awake\n");
if (!_threads_active) {
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc
index 2524a3c0b0..87ef3d2476 100644
--- a/libs/ardour/import.cc
+++ b/libs/ardour/import.cc
@@ -488,7 +488,7 @@ Session::import_files (ImportStatus& status)
return;
}
}
-
+
if (channels == 0) {
error << _("Import: file contains no channels.") << endmsg;
continue;
@@ -553,7 +553,7 @@ Session::import_files (ImportStatus& status)
Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
}
}
-
+
/* imported, copied files cannot be written or removed
*/
@@ -591,7 +591,7 @@ Session::import_files (ImportStatus& status)
} catch (...) {
error << _("Failed to remove some files after failed/cancelled import operation") << endmsg;
}
-
+
}
status.done = true;
diff --git a/libs/ardour/instrument_info.cc b/libs/ardour/instrument_info.cc
index c2055e207e..c673170b72 100644
--- a/libs/ardour/instrument_info.cc
+++ b/libs/ardour/instrument_info.cc
@@ -88,7 +88,7 @@ InstrumentInfo::get_patch_name (uint16_t bank, uint8_t program, uint8_t channel)
}
MIDI::Name::PatchPrimaryKey patch_key (program, bank);
-
+
boost::shared_ptr<MIDI::Name::Patch> patch =
MIDI::Name::MidiPatchManager::instance().find_patch (external_instrument_model,
external_instrument_mode, channel, patch_key);
@@ -102,7 +102,7 @@ InstrumentInfo::get_patch_name (uint16_t bank, uint8_t program, uint8_t channel)
return string_compose ("prg %1 bnk %2",program + MIDI_BP_ZERO , bank + MIDI_BP_ZERO);
}
-}
+}
string
InstrumentInfo::get_controller_name (Evoral::Parameter param) const
@@ -118,7 +118,7 @@ InstrumentInfo::get_controller_name (Evoral::Parameter param) const
if (!dev_names) {
return "";
}
-
+
boost::shared_ptr<ChannelNameSet> chan_names(
dev_names->channel_name_set_by_channel(
external_instrument_mode, param.channel()));
@@ -133,7 +133,7 @@ InstrumentInfo::get_controller_name (Evoral::Parameter param) const
}
return control_names->control(param.id())->name();
-}
+}
boost::shared_ptr<MIDI::Name::ChannelNameSet>
InstrumentInfo::get_patches (uint8_t channel)
@@ -164,7 +164,7 @@ InstrumentInfo::plugin_programs_to_channel_name_set (boost::shared_ptr<Processor
}
boost::shared_ptr<Plugin> pp = insert->plugin();
-
+
if (pp->current_preset_uses_general_midi()) {
patch_list = InstrumentInfo::general_midi_patches ();
@@ -174,11 +174,11 @@ InstrumentInfo::plugin_programs_to_channel_name_set (boost::shared_ptr<Processor
std::vector<Plugin::PresetRecord> presets = pp->get_presets ();
std::vector<Plugin::PresetRecord>::iterator i;
int n;
-
+
/* XXX note the assumption that plugin presets start their numbering at
* zero
*/
-
+
for (n = 0, i = presets.begin(); i != presets.end(); ++i, ++n) {
if ((*i).number >= 0) {
patch_list.push_back (boost::shared_ptr<Patch> (new Patch ((*i).label, n)));
@@ -202,7 +202,7 @@ InstrumentInfo::plugin_programs_to_channel_name_set (boost::shared_ptr<Processor
cns->set_patch_banks (patch_banks);
return cns;
-}
+}
const MIDI::Name::PatchNameList&
InstrumentInfo::general_midi_patches()
@@ -222,7 +222,7 @@ InstrumentInfo::get_plugin_patch_name (boost::shared_ptr<Processor> p, uint16_t
boost::shared_ptr<PluginInsert> insert = boost::dynamic_pointer_cast<PluginInsert> (p);
if (insert) {
boost::shared_ptr<Plugin> pp = insert->plugin();
-
+
if (pp->current_preset_uses_general_midi()) {
return MIDI::Name::general_midi_program_names[std::min((uint8_t) 127,program)];
}
diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc
index 1eae5d3171..4947231c84 100644
--- a/libs/ardour/internal_return.cc
+++ b/libs/ardour/internal_return.cc
@@ -39,7 +39,7 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e
}
Glib::Threads::Mutex::Lock lm (_sends_mutex, Glib::Threads::TRY_LOCK);
-
+
if (lm.locked ()) {
for (list<InternalSend*>::iterator i = _sends.begin(); i != _sends.end(); ++i) {
if ((*i)->active () && (!(*i)->source_route() || (*i)->source_route()->active())) {
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index e8e560c7c0..60de2087f3 100644
--- a/libs/ardour/internal_send.cc
+++ b/libs/ardour/internal_send.cc
@@ -148,10 +148,10 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame
} else {
if (role() == Listen) {
/* We're going to the monitor bus, so discard MIDI data */
-
+
uint32_t const bufs_audio = bufs.count().get (DataType::AUDIO);
uint32_t const mixbufs_audio = mixbufs.count().get (DataType::AUDIO);
-
+
/* monitor-section has same number of channels as master-bus (on creation).
*
* There is no clear answer what should happen when trying to PFL or AFL
@@ -400,4 +400,4 @@ InternalSend::cycle_start (pframes_t /*nframes*/)
for (BufferSet::audio_iterator b = mixbufs.audio_begin(); b != mixbufs.audio_end(); ++b) {
b->prepare ();
}
-}
+}
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index c69006c745..a274f4995b 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -113,7 +113,7 @@ IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
* ::disconnect()
*/
if (_ports.contains (a) || _ports.contains (b)) {
- changed (IOChange (IOChange::ConnectionsChanged), this); /* EMIT SIGNAL */
+ changed (IOChange (IOChange::ConnectionsChanged), this); /* EMIT SIGNAL */
}
} else {
/* we didn't get the lock, so assume that we're inside
@@ -299,7 +299,7 @@ IO::remove_port (boost::shared_ptr<Port> port, void* src)
}
_session.set_dirty ();
-
+
return 0;
}
@@ -321,12 +321,12 @@ IO::add_port (string destination, void* src, DataType type)
ChanCount before = _ports.count ();
ChanCount after = before;
after.set (type, after.get (type) + 1);
-
+
bool const r = PortCountChanging (after); /* EMIT SIGNAL */
if (r) {
return -1;
}
-
+
IOChange change;
{
@@ -339,7 +339,7 @@ IO::add_port (string destination, void* src, DataType type)
/* Create a new port */
string portname = build_legal_port_name (type);
-
+
if (_direction == Input) {
if ((our_port = _session.engine().register_input_port (type, portname)) == 0) {
error << string_compose(_("IO: cannot register input port %1"), portname) << endmsg;
@@ -355,7 +355,7 @@ IO::add_port (string destination, void* src, DataType type)
change.before = _ports.count ();
_ports.add (our_port);
}
-
+
PortCountChanged (n_ports()); /* EMIT SIGNAL */
change.type = IOChange::ConfigurationChanged;
change.after = _ports.count ();
@@ -575,7 +575,7 @@ IO::state (bool /*full_state*/)
snprintf (buf, sizeof (buf), "%" PRId64, _user_latency);
node->add_property (X_("user-latency"), buf);
-
+
return *node;
}
@@ -983,9 +983,9 @@ IO::prepare_for_reset (XMLNode& node, const std::string& name)
for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == "Port") {
-
+
prop = (*i)->property (X_("name"));
-
+
if (prop) {
string new_name;
string old = prop->value();
@@ -993,10 +993,10 @@ IO::prepare_for_reset (XMLNode& node, const std::string& name)
if (slash != string::npos) {
/* port name is of form: <IO-name>/<port-name> */
-
+
new_name = name;
new_name += old.substr (old.find ('/'));
-
+
prop->set_value (new_name);
}
}
diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc
index d23afce612..824006206f 100644
--- a/libs/ardour/io_processor.cc
+++ b/libs/ardour/io_processor.cc
@@ -167,7 +167,7 @@ IOProcessor::set_state (const XMLNode& node, int version)
XMLNodeIterator niter;
const string instr = enum_2_string (IO::Input);
const string outstr = enum_2_string (IO::Output);
-
+
if (_own_input) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
const XMLProperty* prop;
@@ -182,21 +182,21 @@ IOProcessor::set_state (const XMLNode& node, int version)
}
}
}
-
+
if (io_node) {
_input->set_state(*io_node, version);
-
+
// legacy sessions: use IO name
if ((prop = node.property ("name")) == 0) {
set_name (_input->name());
}
-
+
} else {
/* no input, which is OK */
}
-
+
}
-
+
if (_own_output) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "IO") {
@@ -213,10 +213,10 @@ IOProcessor::set_state (const XMLNode& node, int version)
}
}
}
-
+
if (io_node) {
_output->set_state(*io_node, version);
-
+
// legacy sessions: use IO name
if ((prop = node.property ("name")) == 0) {
set_name (_output->name());
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index 61149c78a0..88f40c1f84 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -956,13 +956,13 @@ LadspaPlugin::do_save_preset (string name)
LADSPA_PortDescriptor
LadspaPlugin::port_descriptor (uint32_t i) const
{
- if (i < _descriptor->PortCount) {
+ if (i < _descriptor->PortCount) {
return _descriptor->PortDescriptors[i];
}
-
+
warning << "LADSPA plugin port index " << i << " out of range." << endmsg;
return 0;
}
-
-
+
+
diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc
index 7918f34449..cd3191b1ff 100644
--- a/libs/ardour/linux_vst_support.cc
+++ b/libs/ardour/linux_vst_support.cc
@@ -83,16 +83,16 @@ VSTState *
vstfx_new ()
{
VSTState* vstfx = (VSTState *) calloc (1, sizeof (VSTState));
-
+
/*Mutexes*/
-
+
pthread_mutex_init (&vstfx->lock, 0);
pthread_cond_init (&vstfx->window_status_change, 0);
pthread_cond_init (&vstfx->plugin_dispatcher_called, 0);
pthread_cond_init (&vstfx->window_created, 0);
/*Safe values*/
-
+
vstfx->want_program = -1;
vstfx->want_chunk = 0;
vstfx->n_pending_keys = 0;
@@ -103,7 +103,7 @@ vstfx_new ()
vstfx->eventProc = 0;
vstfx->extra_data = 0;
vstfx->want_resize = 0;
-
+
return vstfx;
}
@@ -131,35 +131,35 @@ void* vstfx_load_vst_library(const char* path)
PBD::error << string_compose (_("Could not open existing LXVST plugin: %1"), dlerror()) << endmsg;
return 0;
}
-
+
/*We didn't find the library so try and get the path specified in the
env variable LXVST_PATH*/
envdup = getenv ("LXVST_PATH");
-
+
/*Path not specified - not much more we can do*/
-
+
if (envdup == 0)
return 0;
-
+
/*Copy the path into envdup*/
-
+
envdup = strdup (envdup);
-
+
if (envdup == 0)
return 0;
-
+
len2 = strlen(path);
/*Try all the possibilities in the path - deliminated by : */
char *saveptr;
lxvst_path = strtok_r (envdup, ":", &saveptr);
-
+
while (lxvst_path != 0)
{
vstfx_error ("\"%s\"", lxvst_path);
len1 = strlen(lxvst_path);
-
+
if (full_path) free(full_path);
full_path = (char*)malloc(len1 + 1 + len2 + 1);
memcpy(full_path, lxvst_path, len1);
@@ -174,7 +174,7 @@ void* vstfx_load_vst_library(const char* path)
/*Succeeded */
break;
}
-
+
/*Try again*/
lxvst_path = strtok_r (0, ":", &saveptr);
@@ -195,18 +195,18 @@ vstfx_load (const char *path)
{
char* buf = 0;
VSTHandle* fhandle;
-
+
/*Create a new handle we can use to reference the plugin*/
fhandle = vstfx_handle_new();
-
+
/*See if we have .so appended to the path - if not we need to make sure it is added*/
if (strstr (path, ".so") == 0)
{
/*Append the .so to the path - Make sure the path has enough space*/
-
+
buf = (char *)malloc(strlen(path) + 4); //The .so and a terminating zero
sprintf (buf, "%s.so", path);
@@ -215,7 +215,7 @@ vstfx_load (const char *path)
else
{
/*We already have .so appened to the filename*/
-
+
buf = strdup(path);
}
@@ -223,7 +223,7 @@ vstfx_load (const char *path)
we don't know anything about its name until we load and instantiate the plugin
which we don't want to do at this point
*/
-
+
fhandle->name = strdup (PBD::basename_nosuffix (path).c_str());
/*call load_vstfx_library to actually load the .so into memory*/
@@ -231,9 +231,9 @@ vstfx_load (const char *path)
if ((fhandle->dll = vstfx_load_vst_library (buf)) == 0)
{
vstfx_unload (fhandle);
-
+
free(buf);
-
+
return 0;
}
@@ -250,11 +250,11 @@ vstfx_load (const char *path)
if (fhandle->main_entry == 0)
{
/*If it can't be found, unload the plugin and return a 0 handle*/
-
+
vstfx_unload (fhandle);
-
+
free(buf);
-
+
return 0;
}
@@ -274,7 +274,7 @@ vstfx_unload (VSTHandle* fhandle)
{
/*Still have plugin instances - can't unload the library
- actually dlclose keeps an instance count anyway*/
-
+
return -1;
}
@@ -290,9 +290,9 @@ vstfx_unload (VSTHandle* fhandle)
{
free (fhandle->name);
}
-
+
/*Don't need the plugin handle any more*/
-
+
free (fhandle);
return 0;
}
@@ -317,29 +317,29 @@ vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr)
free (vstfx);
return 0;
}
-
+
vstfx->handle = fhandle;
vstfx->plugin->user = userptr;
-
+
if (vstfx->plugin->magic != kEffectMagic)
{
vstfx_error ("** ERROR ** VSTFX : %s is not a VST plugin\n", fhandle->name);
free (vstfx);
return 0;
}
-
+
vstfx->plugin->dispatcher (vstfx->plugin, effOpen, 0, 0, 0, 0);
-
+
/*May or May not need to 'switch the plugin on' here - unlikely
since FST doesn't and most plugins start up 'On' by default - I think this is the least of our worries*/
-
+
//vstfx->plugin->dispatcher (vstfx->plugin, effMainsChanged, 0, 1, 0, 0);
-
+
vstfx->vst_version = vstfx->plugin->dispatcher (vstfx->plugin, effGetVstVersion, 0, 0, 0, 0);
-
+
vstfx->handle->plugincnt++;
vstfx->wantIdle = 0;
-
+
return vstfx;
}
@@ -348,33 +348,33 @@ vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr)
void vstfx_close (VSTState* vstfx)
{
vstfx_destroy_editor(vstfx);
-
+
if(vstfx->plugin)
{
vstfx->plugin->dispatcher (vstfx->plugin, effMainsChanged, 0, 0, 0, 0);
-
+
/*Calling dispatcher with effClose will cause the plugin's destructor to
be called, which will also remove the editor if it exists*/
-
+
vstfx->plugin->dispatcher (vstfx->plugin, effClose, 0, 0, 0, 0);
}
if (vstfx->handle->plugincnt)
vstfx->handle->plugincnt--;
-
+
/*vstfx_unload will unload the dll if the instance count allows -
we need to do this because some plugins keep their own instance count
and (JUCE) manages the plugin UI in its own thread. When the plugins
internal instance count reaches zero, JUCE stops the UI thread and won't
restart it until the next time the library is loaded. If we don't unload
the lib JUCE will never restart*/
-
-
+
+
if (vstfx->handle->plugincnt)
{
return;
}
-
+
/*Valid plugin loaded - so we can unload it and 0 the pointer
to it. We can't free the handle here because we don't know what else
might need it. It should be / is freed when the plugin is deleted*/
@@ -403,11 +403,11 @@ vstfx_save_state (VSTState* vstfx, char * filename)
int success;
/* write header */
-
+
fprintf(f, "<plugin_state>\n");
success = vstfx_call_dispatcher(vstfx, effGetProductString, 0, 0, productString, 0);
-
+
if(success == 1)
{
fprintf (f, " <check field=\"productString\" value=\"%s\"/>\n", productString);
@@ -418,7 +418,7 @@ vstfx_save_state (VSTState* vstfx, char * filename)
}
success = vstfx_call_dispatcher(vstfx, effGetEffectName, 0, 0, effectName, 0);
-
+
if(success == 1)
{
fprintf (f, " <check field=\"effectName\" value=\"%s\"/>\n", effectName);
@@ -430,7 +430,7 @@ vstfx_save_state (VSTState* vstfx, char * filename)
}
success = vstfx_call_dispatcher(vstfx, effGetVendorString, 0, 0, vendorString, 0);
-
+
if( success == 1 )
{
fprintf (f, " <check field=\"vendorString\" value=\"%s\"/>\n", vendorString);
@@ -450,7 +450,7 @@ vstfx_save_state (VSTState* vstfx, char * filename)
for(i=0; i < numParams; i++)
{
float val;
-
+
pthread_mutex_lock( &vstfx->lock );
val = vstfx->plugin->getParameter(vstfx->plugin, i );
pthread_mutex_unlock( &vstfx->lock );
@@ -494,17 +494,17 @@ vstfx_save_state (VSTState* vstfx, char * filename)
int vstfx_call_dispatcher (VSTState* vstfx, int opcode, int index, int val, void *ptr, float opt)
{
pthread_mutex_lock (&vstfx->lock);
-
+
/*Set up the opcode and parameters*/
-
+
vstfx->dispatcher_opcode = opcode;
vstfx->dispatcher_index = index;
vstfx->dispatcher_val = val;
vstfx->dispatcher_ptr = ptr;
vstfx->dispatcher_opt = opt;
-
+
/*Signal that we want the call to happen*/
-
+
vstfx->dispatcher_wantcall = 1;
/*Wait for the call to happen*/
@@ -513,6 +513,6 @@ int vstfx_call_dispatcher (VSTState* vstfx, int opcode, int index, int val, void
pthread_mutex_unlock (&vstfx->lock);
/*Return the result*/
-
+
return vstfx->dispatcher_retval;
}
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index 685cd6dd94..1b63ce4431 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -148,7 +148,7 @@ Location::operator= (const Location& other)
_bbt_end = other._bbt_end;
_flags = other._flags;
_position_lock_style = other._position_lock_style;
-
+
/* XXX need to copy scene change */
/* copy is not locked even if original was */
@@ -240,7 +240,7 @@ Location::set_start (framepos_t s, bool force, bool allow_bbt_recompute)
}
start_changed (this); /* EMIT SIGNAL */
StartChanged (); /* EMIT SIGNAL */
-
+
if (is_session_range ()) {
Session::StartTimeChanged (old); /* EMIT SIGNAL */
AudioFileSource::set_header_position_offset (s);
@@ -688,7 +688,7 @@ Location::set_state (const XMLNode& node, int version)
}
XMLNode* scene_child = find_named_node (node, SceneChange::xml_node_name);
-
+
if (scene_child) {
_scene_change = SceneChange::factory (*scene_child, version);
}
@@ -1191,7 +1191,7 @@ Locations::first_mark_before (framepos_t frame, bool include_special_ranges)
{
Glib::Threads::Mutex::Lock lm (lock);
vector<LocationPair> locs;
-
+
for (LocationList::iterator i = locations.begin(); i != locations.end(); ++i) {
locs.push_back (make_pair ((*i)->start(), (*i)));
if (!(*i)->is_mark()) {
@@ -1239,7 +1239,7 @@ Locations::mark_at (framepos_t pos, framecnt_t slop) const
} else {
delta = (*i)->start() - pos;
}
-
+
if (slop == 0 && delta == 0) {
/* special case: no slop, and direct hit for position */
return *i;
@@ -1272,7 +1272,7 @@ Locations::first_mark_after (framepos_t frame, bool include_special_ranges)
LocationStartEarlierComparison cmp;
sort (locs.begin(), locs.end(), cmp);
-
+
/* locs is sorted in reverse order */
for (vector<LocationPair>::iterator i = locs.begin(); i != locs.end(); ++i) {
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 1c3db86db5..2294c467c3 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -2388,7 +2388,7 @@ LV2Plugin::Impl::designated_input (const char* uri, void** bufptrs[], void** buf
static bool lv2_filter (const string& str, void* /*arg*/)
{
/* Not a dotfile, has a prefix before a period, suffix is "lv2" */
-
+
return str[0] != '.' && (str.length() > 3 && str.find (".lv2") == (str.length() - 4));
}
diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc
index b735fe74fb..dc8deb7727 100644
--- a/libs/ardour/midi_buffer.cc
+++ b/libs/ardour/midi_buffer.cc
@@ -304,9 +304,9 @@ MidiBuffer::second_simultaneous_midi_byte_is_first (uint8_t a, uint8_t b)
/* two events at identical times. we need to determine
the order in which they should occur.
-
+
the rule is:
-
+
Controller messages
Program Change
Note Off
@@ -315,22 +315,22 @@ MidiBuffer::second_simultaneous_midi_byte_is_first (uint8_t a, uint8_t b)
Channel Pressure
Pitch Bend
*/
-
+
if ((a) >= 0xf0 || (b) >= 0xf0 || ((a & 0xf) != (b & 0xf))) {
-
+
/* if either message is not a channel message, or if the channels are
* different, we don't care about the type.
*/
-
+
b_first = true;
-
+
} else {
-
+
switch (b & 0xf0) {
case MIDI_CMD_CONTROL:
b_first = true;
break;
-
+
case MIDI_CMD_PGM_CHANGE:
switch (a & 0xf0) {
case MIDI_CMD_CONTROL:
@@ -344,7 +344,7 @@ MidiBuffer::second_simultaneous_midi_byte_is_first (uint8_t a, uint8_t b)
b_first = true;
}
break;
-
+
case MIDI_CMD_NOTE_OFF:
switch (a & 0xf0) {
case MIDI_CMD_CONTROL:
@@ -358,7 +358,7 @@ MidiBuffer::second_simultaneous_midi_byte_is_first (uint8_t a, uint8_t b)
b_first = true;
}
break;
-
+
case MIDI_CMD_NOTE_ON:
switch (a & 0xf0) {
case MIDI_CMD_CONTROL:
@@ -385,7 +385,7 @@ MidiBuffer::second_simultaneous_midi_byte_is_first (uint8_t a, uint8_t b)
b_first = true;
}
break;
-
+
case MIDI_CMD_CHANNEL_PRESSURE:
switch (a & 0xf0) {
case MIDI_CMD_CONTROL:
@@ -414,10 +414,10 @@ MidiBuffer::second_simultaneous_midi_byte_is_first (uint8_t a, uint8_t b)
break;
}
}
-
+
return b_first;
}
-
+
/** Merge \a other into this buffer. Realtime safe. */
bool
MidiBuffer::merge_in_place (const MidiBuffer &other)
@@ -507,20 +507,20 @@ MidiBuffer::merge_in_place (const MidiBuffer &other)
(*us).time(), (*them).time(),
(int) *(_data + us.offset + sizeof (TimeType)),
(int) *(other._data + them.offset + sizeof (TimeType))));
-
+
uint8_t our_midi_status_byte = *(_data + us.offset + sizeof (TimeType));
uint8_t their_midi_status_byte = *(other._data + them.offset + sizeof (TimeType));
bool them_first = second_simultaneous_midi_byte_is_first (our_midi_status_byte, their_midi_status_byte);
-
+
DEBUG_TRACE (DEBUG::MidiIO, string_compose ("other message came first ? %1\n", them_first));
-
+
if (!them_first) {
/* skip past our own event */
++us;
}
-
+
bytes_to_merge = sizeof (TimeType) + (*them).size();
-
+
/* move our remaining events later in the buffer by
* enough to fit the one message we're going to merge
*/
@@ -554,11 +554,11 @@ MidiBuffer::merge_in_place (const MidiBuffer &other)
++them;
} else {
-
+
/* advance past our own events to get to the correct insertion
point for the next event(s) from "other"
*/
-
+
while (us != end() && (*us).time() <= (*them).time()) {
++us;
}
@@ -571,7 +571,7 @@ MidiBuffer::merge_in_place (const MidiBuffer &other)
if (us == end()) {
/* just append the rest of other and we're done*/
-
+
memcpy (_data + us.offset, other._data + them.offset, other._size - them.offset);
_size += other._size - them.offset;
assert(_size <= _capacity);
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index c2da230701..7d980e5d1e 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -458,7 +458,7 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
that it can read it if it likes.
*/
_gui_feed_buffer.clear ();
-
+
for (MidiBuffer::iterator i = buf.begin(); i != buf.end(); ++i) {
/* This may fail if buf is larger than _gui_feed_buffer, but it's not really
the end of the world if it does.
@@ -509,7 +509,7 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
if (need_disk_signal) {
/* copy the diskstream data to all output buffers */
-
+
MidiBuffer& mbuf (bufs.get_midi (0));
get_playback (mbuf, playback_distance);
@@ -583,7 +583,7 @@ MidiDiskstream::commit (framecnt_t playback_distance)
* but we do need to check so that the decision on whether or not we
* need the butler is done correctly.
*/
-
+
/* furthermore..
*
* Doing heavy GUI operations[1] can stall also the butler.
@@ -755,7 +755,7 @@ MidiDiskstream::read (framepos_t& start, framecnt_t dur, bool reversed)
id(), this_read, start) << endmsg;
return -1;
}
-
+
g_atomic_int_add (&_frames_written_to_ringbuffer, this_read);
if (reversed) {
@@ -1157,7 +1157,7 @@ MidiDiskstream::set_record_enabled (bool yn)
} else {
disengage_record_enable ();
}
-
+
RecordEnableChanged (); /* EMIT SIGNAL */
}
}
@@ -1168,18 +1168,18 @@ MidiDiskstream::set_record_safe (bool yn)
if (!recordable() || !_session.record_enabling_legal() || _io->n_ports().n_midi() == 0) { // REQUIRES REVIEW
return;
}
-
+
/* yes, i know that this not proof against race conditions, but its
good enough. i think.
*/
-
+
if (record_safe () != yn) {
if (yn) {
engage_record_safe ();
} else {
disengage_record_safe ();
}
-
+
RecordSafeChanged (); /* EMIT SIGNAL */
}
}
@@ -1194,7 +1194,7 @@ MidiDiskstream::prep_record_enable ()
bool const rolling = _session.transport_speed() != 0.0f;
boost::shared_ptr<MidiPort> sp = _source_port.lock ();
-
+
if (sp && Config->get_monitoring_model() == HardwareMonitoring) {
sp->request_input_monitoring (!(_session.config.get_auto_input() && rolling));
}
@@ -1321,14 +1321,14 @@ MidiDiskstream::steal_write_source_name ()
try {
string new_path = _session.new_midi_source_path (name());
-
+
if (_write_source->rename (new_path)) {
return string();
}
} catch (...) {
return string ();
}
-
+
return our_old_name;
}
@@ -1360,7 +1360,7 @@ void
MidiDiskstream::ensure_input_monitoring (bool yn)
{
boost::shared_ptr<MidiPort> sp = _source_port.lock ();
-
+
if (sp) {
sp->ensure_input_monitoring (yn);
}
@@ -1385,7 +1385,7 @@ float
MidiDiskstream::playback_buffer_load () const
{
/* For MIDI it's not trivial to differentiate the following two cases:
-
+
1. The playback buffer is empty because the system has run out of time to fill it.
2. The playback buffer is empty because there is no more data on the playlist.
@@ -1393,7 +1393,7 @@ MidiDiskstream::playback_buffer_load () const
cannot keep up when #2 happens, when in fact it can. Since MIDI data rates
are so low compared to audio, just give a pretend answer here.
*/
-
+
return 1;
}
@@ -1401,7 +1401,7 @@ float
MidiDiskstream::capture_buffer_load () const
{
/* We don't report playback buffer load, so don't report capture load either */
-
+
return 1;
}
@@ -1437,7 +1437,7 @@ MidiDiskstream::get_playback (MidiBuffer& dst, framecnt_t nframes)
// _playback_buf->dump (cerr);
// cerr << "----------------\n";
- size_t events_read = 0;
+ size_t events_read = 0;
if (loc) {
framepos_t effective_start;
@@ -1447,7 +1447,7 @@ MidiDiskstream::get_playback (MidiBuffer& dst, framecnt_t nframes)
} else {
effective_start = playback_sample;
}
-
+
DEBUG_TRACE (DEBUG::MidiDiskstreamIO, string_compose ("looped, effective start adjusted to %1\n", effective_start));
if (effective_start == loc->start()) {
@@ -1484,7 +1484,7 @@ MidiDiskstream::get_playback (MidiBuffer& dst, framecnt_t nframes)
loc->start(), second));
events_read += _playback_buf->read (dst, loc->start(), second);
}
-
+
} else {
DEBUG_TRACE (DEBUG::MidiDiskstreamIO, string_compose ("loop read #3, adjusted start as %1 for %2\n",
effective_start, nframes));
@@ -1535,7 +1535,7 @@ boost::shared_ptr<MidiBuffer>
MidiDiskstream::get_gui_feed_buffer () const
{
boost::shared_ptr<MidiBuffer> b (new MidiBuffer (AudioEngine::instance()->raw_buffer_size (DataType::MIDI)));
-
+
Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex);
b->copy (_gui_feed_buffer);
return b;
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index 27fb61b11d..fd08428a68 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -321,7 +321,7 @@ MidiModel::NoteDiffCommand::operator() ()
_removed_notes.push_back (*i);
}
}
-
+
if (!side_effect_removals.empty()) {
cerr << "SER: \n";
for (set<NotePtr>::iterator i = side_effect_removals.begin(); i != side_effect_removals.end(); ++i) {
@@ -364,7 +364,7 @@ MidiModel::NoteDiffCommand::undo ()
assert (i->note);
}
}
-
+
for (ChangeList::iterator i = _changes.begin(); i != _changes.end(); ++i) {
Property prop = i->property;
@@ -439,7 +439,7 @@ MidiModel::NoteDiffCommand::undo ()
_model->add_note_unlocked (*i);
}
}
-
+
_model->ContentsChanged(); /* EMIT SIGNAL */
}
@@ -1242,7 +1242,7 @@ MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
int channel = 0;
int program = 0;
int bank = 0;
-
+
if ((prop_id = n->property ("id")) != 0) {
istringstream s (prop_id->value());
s >> id;
@@ -2027,6 +2027,6 @@ void
MidiModel::control_list_marked_dirty ()
{
AutomatableSequence<Evoral::Beats>::control_list_marked_dirty ();
-
+
ContentsChanged (); /* EMIT SIGNAL */
}
diff --git a/libs/ardour/midi_patch_manager.cc b/libs/ardour/midi_patch_manager.cc
index 93f0b7e235..4f5cff1747 100644
--- a/libs/ardour/midi_patch_manager.cc
+++ b/libs/ardour/midi_patch_manager.cc
@@ -60,7 +60,7 @@ MidiPatchManager::add_session_patches ()
if (!_session) {
return;
}
-
+
std::string path_to_patches = _session->session_directory().midi_patch_path();
if (!Glib::file_test (path_to_patches, Glib::FILE_TEST_EXISTS)) {
@@ -135,7 +135,7 @@ MidiPatchManager::refresh()
<< endmsg;
continue;
}
-
+
_documents[device->first] = document;
_master_devices_by_model[device->first] = device->second;
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index 85d5c95a5f..d959ff9d91 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -67,14 +67,14 @@ MidiPort::cycle_start (pframes_t nframes)
MidiBuffer& mb (get_midi_buffer (nframes));
/* dump incoming MIDI to parser */
-
+
for (MidiBuffer::iterator b = mb.begin(); b != mb.end(); ++b) {
uint8_t* buf = (*b).buffer();
-
+
_self_parser.set_timestamp (now + (*b).time());
-
+
uint32_t limit = (*b).size();
-
+
for (size_t n = 0; n < limit; ++n) {
_self_parser.scanner (buf[n]);
}
@@ -107,13 +107,13 @@ MidiPort::get_midi_buffer (pframes_t nframes)
*/
for (pframes_t i = 0; i < event_count; ++i) {
-
+
pframes_t timestamp;
size_t size;
uint8_t* buf;
-
+
port_engine.midi_event_get (timestamp, size, &buf, buffer, i);
-
+
if (buf[0] == 0xfe) {
/* throw away active sensing */
continue;
@@ -122,9 +122,9 @@ MidiPort::get_midi_buffer (pframes_t nframes)
buf[0] = 0x80 | (buf[0] & 0x0F); /* note off */
buf[2] = 0x40; /* default velocity */
}
-
+
/* check that the event is in the acceptable time range */
-
+
if ((timestamp >= (_global_port_buffer_offset + _port_buffer_offset)) &&
(timestamp < (_global_port_buffer_offset + _port_buffer_offset + nframes))) {
_buffer->push_back (timestamp, size, buf);
@@ -192,14 +192,14 @@ MidiPort::flush_buffers (pframes_t nframes)
if (sends_output ()) {
void* port_buffer = 0;
-
+
if (_resolve_required) {
port_buffer = port_engine.get_buffer (_port_handle, nframes);
/* resolve all notes at the start of the buffer */
resolve_notes (port_buffer, 0);
_resolve_required = false;
}
-
+
if (_buffer->empty()) {
return;
}
@@ -216,12 +216,12 @@ MidiPort::flush_buffers (pframes_t nframes)
if (sends_output() && _trace_on) {
uint8_t const * const buf = ev.buffer();
- const framepos_t now = AudioEngine::instance()->sample_time_at_cycle_start();
+ const framepos_t now = AudioEngine::instance()->sample_time_at_cycle_start();
_self_parser.set_timestamp (now + ev.time());
-
+
uint32_t limit = ev.size();
-
+
for (size_t n = 0; n < limit; ++n) {
_self_parser.scanner (buf[n]);
}
diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc
index 7c72718b69..9258b2f7dc 100644
--- a/libs/ardour/midi_ring_buffer.cc
+++ b/libs/ardour/midi_ring_buffer.cc
@@ -212,7 +212,7 @@ MidiRingBuffer<T>::flush (framepos_t /*start*/, framepos_t end)
assert (success);
ev_time = *(reinterpret_cast<T*>((uintptr_t)peekbuf));
-
+
if (ev_time >= end) {
break;
}
diff --git a/libs/ardour/midi_scene_change.cc b/libs/ardour/midi_scene_change.cc
index 91f2dd4d7c..ed0729b071 100644
--- a/libs/ardour/midi_scene_change.cc
+++ b/libs/ardour/midi_scene_change.cc
@@ -77,7 +77,7 @@ MIDISceneChange::get_bank_lsb_message (uint8_t* buf, size_t size) const
buf[0] = 0xB0 | (_channel & 0xf);
buf[1] = 0x20;
- buf[2] = _bank & 0x7f;
+ buf[2] = _bank & 0x7f;
return 3;
}
diff --git a/libs/ardour/midi_scene_changer.cc b/libs/ardour/midi_scene_changer.cc
index da6fe88331..f586206ba7 100644
--- a/libs/ardour/midi_scene_changer.cc
+++ b/libs/ardour/midi_scene_changer.cc
@@ -41,7 +41,7 @@ MIDISceneChanger::MIDISceneChanger (Session& s)
, last_program_message_time (-1)
, last_delivered_program (-1)
, last_delivered_bank (-1)
-
+
{
/* catch any add/remove/clear etc. for all Locations */
_session.locations()->changed.connect_same_thread (*this, boost::bind (&MIDISceneChanger::locations_changed, this));
@@ -86,7 +86,7 @@ MIDISceneChanger::gather (const Locations::LocationList& locations)
if (msc->bank() >= 0) {
have_seen_bank_changes = true;
}
-
+
scenes.insert (std::make_pair ((*l)->start(), msc));
}
}
@@ -164,7 +164,7 @@ MIDISceneChanger::run (framepos_t start, framepos_t end)
}
Glib::Threads::RWLock::ReaderLock lm (scene_lock, Glib::Threads::TRY_LOCK);
-
+
if (!lm.locked()) {
return;
}
@@ -179,9 +179,9 @@ MIDISceneChanger::run (framepos_t start, framepos_t end)
if (i->first >= end) {
break;
}
-
+
rt_deliver (mbuf, i->first - start, i->second);
-
+
++i;
}
}
@@ -197,9 +197,9 @@ MIDISceneChanger::locate (framepos_t pos)
if (scenes.empty()) {
return;
}
-
+
Scenes::const_iterator i = scenes.lower_bound (pos);
-
+
if (i != scenes.end()) {
if (i->first != pos) {
@@ -223,7 +223,7 @@ MIDISceneChanger::locate (framepos_t pos)
if (msc->program() != last_delivered_program || msc->bank() != last_delivered_bank) {
non_rt_deliver (msc);
}
-}
+}
void
MIDISceneChanger::set_input_port (MIDI::Port* mp)
@@ -231,9 +231,9 @@ MIDISceneChanger::set_input_port (MIDI::Port* mp)
input_port = mp;
incoming_connections.drop_connections();
-
+
if (input_port) {
-
+
/* midi port is asynchronous. MIDI parsing will be carried out
* by the MIDI UI thread which will emit the relevant signals
* and thus invoke our callbacks as necessary.
@@ -303,14 +303,14 @@ MIDISceneChanger::program_change_input (MIDI::Parser& parser, MIDI::byte program
if (!loc) {
/* create a new marker at the desired position */
-
+
std::string new_name;
if (!locations->next_available_name (new_name, _("Scene "))) {
std::cerr << "No new marker name available\n";
return;
}
-
+
loc = new Location (_session, time, time, new_name, Location::IsMark);
new_mark = true;
}
@@ -336,7 +336,7 @@ MIDISceneChanger::program_change_input (MIDI::Parser& parser, MIDI::byte program
}
loc->set_scene_change (boost::shared_ptr<MIDISceneChange> (msc));
-
+
/* this will generate a "changed" signal to be emitted by locations,
and we will call ::gather() to update our list of MIDI events.
*/
diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc
index 3a801901cb..0403461c73 100644
--- a/libs/ardour/midi_state_tracker.cc
+++ b/libs/ardour/midi_state_tracker.cc
@@ -65,7 +65,7 @@ MidiStateTracker::add (uint8_t note, uint8_t chn)
void
MidiStateTracker::remove (uint8_t note, uint8_t chn)
-{
+{
switch (_active_notes[note + 128 * chn]) {
case 0:
break;
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index e0b2f4e225..f3bc2c4f79 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -118,7 +118,7 @@ MidiTrack::set_record_safe (bool yn, void *src)
if (_step_editing) { /* REQUIRES REVIEW */
return;
}
-
+
Track::set_record_safe (yn, src);
}
@@ -130,10 +130,10 @@ MidiTrack::set_diskstream (boost::shared_ptr<Diskstream> ds)
*/
boost::shared_ptr<MidiDiskstream> mds = boost::dynamic_pointer_cast<MidiDiskstream> (ds);
mds->set_note_mode (_note_mode);
-
+
Track::set_diskstream (ds);
- mds->reset_tracker ();
+ mds->reset_tracker ();
_diskstream->set_track (this);
if (Profile->get_trx()) {
@@ -432,13 +432,13 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
}
-
+
/* append immediate messages to the first MIDI buffer (thus sending it to the first output port) */
-
+
write_out_of_band_data (bufs, start_frame, end_frame, nframes);
-
+
/* final argument: don't waste time with automation if we're not recording or rolling */
-
+
process_output_buffers (bufs, start_frame, end_frame, nframes,
declick, (!diskstream->record_enabled() && !_session.transport_stopped()));
@@ -450,7 +450,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
}
need_butler = diskstream->commit (playback_distance);
-
+
return 0;
}
@@ -930,20 +930,20 @@ MidiTrack::act_on_mute ()
midi_diskstream()->resolve_tracker(_immediate_events, 0);
}
}
-
+
void
MidiTrack::set_monitoring (MonitorChoice mc)
{
if (mc != _monitoring) {
Track::set_monitoring (mc);
-
+
/* monitoring state changed, so flush out any on notes at the
* port level.
*/
PortSet& ports (_output->ports());
-
+
for (PortSet::iterator p = ports.begin(); p != ports.end(); ++p) {
boost::shared_ptr<MidiPort> mp = boost::dynamic_pointer_cast<MidiPort> (*p);
if (mp) {
@@ -952,7 +952,7 @@ MidiTrack::set_monitoring (MonitorChoice mc)
}
boost::shared_ptr<MidiDiskstream> md (midi_diskstream());
-
+
if (md) {
md->reset_tracker ();
}
diff --git a/libs/ardour/midi_ui.cc b/libs/ardour/midi_ui.cc
index 0f2392108f..59c718ad2b 100644
--- a/libs/ardour/midi_ui.cc
+++ b/libs/ardour/midi_ui.cc
@@ -104,12 +104,12 @@ MidiControlUI::reset_ports ()
{
vector<AsyncMIDIPort*> ports;
AsyncMIDIPort* p;
-
+
if ((p = dynamic_cast<AsyncMIDIPort*> (_session.midi_input_port()))) {
ports.push_back (p);
}
-
-
+
+
if ((p = dynamic_cast<AsyncMIDIPort*> (_session.mmc_input_port()))) {
ports.push_back (p);
}
@@ -117,11 +117,11 @@ MidiControlUI::reset_ports ()
if ((p = dynamic_cast<AsyncMIDIPort*> (_session.scene_input_port()))) {
ports.push_back (p);
}
-
+
if (ports.empty()) {
return;
}
-
+
for (vector<AsyncMIDIPort*>::const_iterator pi = ports.begin(); pi != ports.end(); ++pi) {
(*pi)->xthread().set_receive_handler (sigc::bind (sigc::mem_fun (this, &MidiControlUI::midi_input_handler), *pi));
(*pi)->xthread().attach (_main_loop->get_context());
diff --git a/libs/ardour/midiport_manager.cc b/libs/ardour/midiport_manager.cc
index fe6a534f24..5460df3824 100644
--- a/libs/ardour/midiport_manager.cc
+++ b/libs/ardour/midiport_manager.cc
@@ -73,7 +73,7 @@ MidiPortManager::create_ports ()
if (_midi_in) {
return;
}
-
+
_midi_in = AudioEngine::instance()->register_input_port (DataType::MIDI, X_("MIDI control in"), true);
_midi_out = AudioEngine::instance()->register_output_port (DataType::MIDI, X_("MIDI control out"), true);
@@ -143,7 +143,7 @@ MidiPortManager::set_midi_port_states (const XMLNodeList&nodes)
ports.insert (make_pair (_mmc_output_port->name(), _mmc_out));
ports.insert (make_pair (_scene_output_port->name(), _scene_out));
ports.insert (make_pair (_scene_input_port->name(), _scene_in));
-
+
for (XMLNodeList::const_iterator n = nodes.begin(); n != nodes.end(); ++n) {
if ((prop = (*n)->property (X_("name"))) == 0) {
continue;
@@ -153,7 +153,7 @@ MidiPortManager::set_midi_port_states (const XMLNodeList&nodes)
if (p == ports.end()) {
continue;
}
-
+
p->second->set_state (**n, version);
}
}
diff --git a/libs/ardour/monitor_processor.cc b/libs/ardour/monitor_processor.cc
index 427e895f13..92beed547c 100644
--- a/libs/ardour/monitor_processor.cc
+++ b/libs/ardour/monitor_processor.cc
@@ -288,7 +288,7 @@ MonitorProcessor::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /
/* don't double-scale by both track dim and global dim coefficients */
gain_t dim_level = (global_dim == GAIN_COEFF_UNITY ? (_channels[chn]->dim ? dim_level_this_time : GAIN_COEFF_UNITY) : GAIN_COEFF_UNITY);
-
+
if (_channels[chn]->soloed) {
target_gain = _channels[chn]->polarity * _channels[chn]->cut * dim_level * global_cut * global_dim * solo_boost;
} else {
diff --git a/libs/ardour/pannable.cc b/libs/ardour/pannable.cc
index 92e91f53c1..247397d415 100644
--- a/libs/ardour/pannable.cc
+++ b/libs/ardour/pannable.cc
@@ -50,7 +50,7 @@ Pannable::Pannable (Session& s)
, _responding_to_control_auto_state_change (0)
{
//boost_debug_shared_ptr_mark_interesting (this, "pannable");
-
+
add_control (pan_azimuth_control);
add_control (pan_elevation_control);
add_control (pan_width_control);
diff --git a/libs/ardour/panner_shell.cc b/libs/ardour/panner_shell.cc
index d8d760ba8f..72c8fd57d1 100644
--- a/libs/ardour/panner_shell.cc
+++ b/libs/ardour/panner_shell.cc
@@ -187,7 +187,7 @@ PannerShell::set_state (const XMLNode& node, int version)
}
_panner.reset ();
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == X_("Panner")) {
@@ -406,7 +406,7 @@ PannerShell::set_bypassed (bool yn)
if (yn == _bypassed) {
return;
}
-
+
_bypassed = yn;
_session.set_dirty ();
Changed (); /* EMIT SIGNAL */
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 3138df3b9d..959b4884a3 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -557,7 +557,7 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r)
pending_contents_change = false;
RegionAdded (boost::weak_ptr<Region> (r)); /* EMIT SIGNAL */
ContentsChanged (); /* EMIT SIGNAL */
-
+
}
}
@@ -603,7 +603,7 @@ Playlist::flush_notifications (bool from_undo)
remove_dependents (*s);
RegionRemoved (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
}
-
+
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
crossfade_ranges.push_back ((*s)->range ());
/* don't emit RegionAdded signal until relayering is done,
@@ -620,25 +620,25 @@ Playlist::flush_notifications (bool from_undo)
pending_layering = true;
ContentsChanged (); /* EMIT SIGNAL */
}
-
+
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
(*s)->clear_changes ();
RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
}
-
+
if ((regions_changed && !in_set_state) || pending_layering) {
relayer ();
}
-
+
coalesce_and_check_crossfades (crossfade_ranges);
-
+
if (!pending_range_moves.empty ()) {
/* We don't need to check crossfades for these as pending_bounds has
already covered it.
*/
RangesMoved (pending_range_moves, from_undo);
}
-
+
if (!pending_region_extensions.empty ()) {
RegionsExtended (pending_region_extensions);
}
@@ -1225,11 +1225,11 @@ Playlist::flush_notifications (bool from_undo)
while (itimes--) {
for (RegionList::iterator i = other->regions.begin(); i != other->regions.end(); ++i) {
boost::shared_ptr<Region> copy_of_region = RegionFactory::create (*i, true);
-
+
/* put these new regions on top of all existing ones, but preserve
the ordering they had in the original playlist.
*/
-
+
add_region_internal (copy_of_region, (*i)->position() + pos);
set_layer (copy_of_region, copy_of_region->layer() + top);
}
@@ -1523,7 +1523,7 @@ Playlist::core_ripple (framepos_t at, framecnt_t distance, RegionList *exclude)
} else if (new_pos >= limit ) {
new_pos = limit;
}
-
+
(*i)->set_position (new_pos);
}
}
@@ -1783,15 +1783,15 @@ boost::shared_ptr<RegionList>
Playlist::find_regions_at (framepos_t frame)
{
/* Caller must hold lock */
-
+
boost::shared_ptr<RegionList> rlist (new RegionList);
-
+
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if ((*i)->covers (frame)) {
rlist->push_back (*i);
}
}
-
+
return rlist;
}
@@ -1840,13 +1840,13 @@ boost::shared_ptr<RegionList>
Playlist::regions_touched_locked (framepos_t start, framepos_t end)
{
boost::shared_ptr<RegionList> rlist (new RegionList);
-
+
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if ((*i)->coverage (start, end) != Evoral::OverlapNone) {
rlist->push_back (*i);
}
}
-
+
return rlist;
}
@@ -1856,7 +1856,7 @@ Playlist::find_next_transient (framepos_t from, int dir)
RegionReadLock rlock (this);
AnalysisFeatureList points;
AnalysisFeatureList these_points;
-
+
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if (dir > 0) {
if ((*i)->last_frame() < from) {
@@ -1867,30 +1867,30 @@ Playlist::find_next_transient (framepos_t from, int dir)
continue;
}
}
-
+
(*i)->get_transients (these_points);
-
+
/* add first frame, just, err, because */
-
+
these_points.push_back ((*i)->first_frame());
-
+
points.insert (points.end(), these_points.begin(), these_points.end());
these_points.clear ();
}
-
+
if (points.empty()) {
return -1;
}
-
+
TransientDetector::cleanup_transients (points, _session.frame_rate(), 3.0);
bool reached = false;
-
+
if (dir > 0) {
for (AnalysisFeatureList::iterator x = points.begin(); x != points.end(); ++x) {
if ((*x) >= from) {
reached = true;
}
-
+
if (reached && (*x) > from) {
return *x;
}
@@ -1900,13 +1900,13 @@ Playlist::find_next_transient (framepos_t from, int dir)
if ((*x) <= from) {
reached = true;
}
-
+
if (reached && (*x) < from) {
return *x;
}
}
}
-
+
return -1;
}
@@ -1916,17 +1916,17 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
RegionReadLock rlock (this);
boost::shared_ptr<Region> ret;
framepos_t closest = max_framepos;
-
+
bool end_iter = false;
-
+
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
-
+
if(end_iter) break;
-
+
frameoffset_t distance;
boost::shared_ptr<Region> r = (*i);
framepos_t pos = 0;
-
+
switch (point) {
case Start:
pos = r->first_frame ();
@@ -1938,10 +1938,10 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
pos = r->sync_position ();
break;
}
-
+
switch (dir) {
case 1: /* forwards */
-
+
if (pos > frame) {
if ((distance = pos - frame) < closest) {
closest = distance;
@@ -1949,11 +1949,11 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
end_iter = true;
}
}
-
+
break;
-
+
default: /* backwards */
-
+
if (pos < frame) {
if ((distance = frame - pos) < closest) {
closest = distance;
@@ -1962,11 +1962,11 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
} else {
end_iter = true;
}
-
+
break;
}
}
-
+
return ret;
}
@@ -2170,7 +2170,7 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
RegionWriteLock rlock (this);
add_region_internal (region, region->position());
}
-
+
region->resume_property_changes ();
}
@@ -2179,7 +2179,7 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
if (seen_region_nodes && regions.empty()) {
ret = -1;
}
-
+
thaw ();
notify_contents_changed ();
@@ -2358,7 +2358,7 @@ Playlist::set_layer (boost::shared_ptr<Region> region, double new_layer)
}
++i;
}
-
+
copy.insert (i, region);
setup_layering_indices (copy);
diff --git a/libs/ardour/playlist_factory.cc b/libs/ardour/playlist_factory.cc
index 5c3d93a0a0..150ae6c3ac 100644
--- a/libs/ardour/playlist_factory.cc
+++ b/libs/ardour/playlist_factory.cc
@@ -46,9 +46,9 @@ PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden, bool unus
} else if (type->value() == "midi") {
pl = boost::shared_ptr<Playlist> (new MidiPlaylist (s, node, hidden));
}
-
+
pl->set_region_ownership ();
-
+
if (pl && !hidden) {
PlaylistCreated (pl, unused);
}
@@ -69,11 +69,11 @@ PlaylistFactory::create (DataType type, Session& s, string name, bool hidden)
pl = boost::shared_ptr<Playlist> (new AudioPlaylist (s, name, hidden));
else if (type == DataType::MIDI)
pl = boost::shared_ptr<Playlist> (new MidiPlaylist (s, name, hidden));
-
+
if (pl && !hidden) {
PlaylistCreated (pl, false);
}
-
+
return pl;
} catch (...) {
return boost::shared_ptr<Playlist> ();
@@ -86,7 +86,7 @@ PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, boo
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<const AudioPlaylist> apl;
boost::shared_ptr<const MidiPlaylist> mpl;
-
+
try {
if ((apl = boost::dynamic_pointer_cast<const AudioPlaylist> (old)) != 0) {
@@ -100,12 +100,12 @@ PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, boo
if (pl && !hidden) {
PlaylistCreated (pl, false);
}
-
+
return pl;
} catch (...) {
return boost::shared_ptr<Playlist> ();
}
-
+
}
boost::shared_ptr<Playlist>
@@ -123,9 +123,9 @@ PlaylistFactory::create (boost::shared_ptr<const Playlist> old, framepos_t start
pl = boost::shared_ptr<Playlist> (new MidiPlaylist (mpl, start, cnt, name, hidden));
pl->set_region_ownership ();
}
-
+
/* this factory method does NOT notify others */
-
+
return pl;
} catch (...) {
return boost::shared_ptr<Playlist> ();
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc
index 577b12c1a6..89f6d24137 100644
--- a/libs/ardour/plugin.cc
+++ b/libs/ardour/plugin.cc
@@ -396,7 +396,7 @@ Plugin::get_state ()
root->add_property (X_("last-preset-label"), _last_preset.label);
root->add_property (X_("parameter-changed-since-last-preset"), _parameter_changed_since_last_preset ? X_("yes") : X_("no"));
-#ifndef NO_PLUGIN_STATE
+#ifndef NO_PLUGIN_STATE
add_state (root);
#else
if (!seen_get_state_message) {
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index c568437234..98ff9ab4f0 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -167,7 +167,7 @@ PluginInsert::input_streams() const
}
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, input streams = %1, match using %2\n", in, _match.method));
-
+
if (_match.method == Split) {
/* we are splitting 1 processor input to multiple plugin inputs,
@@ -188,7 +188,7 @@ PluginInsert::input_streams() const
return in;
} else {
-
+
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
in.set (*t, in.get (*t) * _plugins.size ());
}
@@ -842,7 +842,7 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & inx, ChanC
We allow replication only for plugins with either zero or 1 inputs and outputs
for every valid data type.
*/
-
+
uint32_t f = 0;
bool can_replicate = true;
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
@@ -910,7 +910,7 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & inx, ChanC
bool could_hide = false;
bool cannot_hide = false;
ChanCount hide_channels;
-
+
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
if (inputs.get(*t) > in.get(*t)) {
/* there is potential to hide, since the plugin has more inputs of type t than the insert */
@@ -1425,7 +1425,7 @@ void
PluginInsert::add_plugin (boost::shared_ptr<Plugin> plugin)
{
plugin->set_insert_id (this->id());
-
+
if (_plugins.empty()) {
/* first (and probably only) plugin instance - connect to relevant signals
*/
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc
index 3218550f99..d375550d9e 100644
--- a/libs/ardour/port.cc
+++ b/libs/ardour/port.cc
@@ -73,7 +73,7 @@ Port::Port (std::string const & n, DataType t, PortFlags f)
cerr << "Failed to register port \"" << _name << "\", reason is unknown from here\n";
throw failed_constructor ();
}
-
+
PortDrop.connect_same_thread (drop_connection, boost::bind (&Port::drop, this));
}
@@ -127,10 +127,10 @@ int
Port::disconnect_all ()
{
if (_port_handle) {
-
+
port_engine.disconnect_all (_port_handle);
_connections.clear ();
-
+
/* a cheaper, less hacky way to do boost::shared_from_this() ...
*/
boost::shared_ptr<Port> pself = port_manager->get_port_by_name (name());
@@ -365,7 +365,7 @@ Port::public_latency_range (bool /*playback*/) const
if (_port_handle) {
r = port_engine.get_latency_range (_port_handle, sends_output() ? true : false);
-
+
DEBUG_TRACE (DEBUG::Latency, string_compose (
"GET PORT %1: %4 PUBLIC latency range %2 .. %3\n",
name(), r.min, r.max,
@@ -520,7 +520,7 @@ Port::get_state () const
}
vector<string> c;
-
+
get_connections (c);
for (vector<string>::const_iterator i = c.begin(); i != c.end(); ++i) {
@@ -554,7 +554,7 @@ Port::set_state (const XMLNode& node, int)
if ((*c)->name() != X_("Connection")) {
continue;
}
-
+
if ((prop = (*c)->property (X_("other"))) == 0) {
continue;
}
diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc
index 04796993e4..46d54cd445 100644
--- a/libs/ardour/port_insert.cc
+++ b/libs/ardour/port_insert.cc
@@ -122,7 +122,7 @@ PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame,
Sample* out = outbuf.data();
_mtdm->process (nframes, in, out);
-
+
outbuf.set_written (true);
}
diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc
index b43158ff0f..e4c066944f 100644
--- a/libs/ardour/port_manager.cc
+++ b/libs/ardour/port_manager.cc
@@ -207,7 +207,7 @@ PortManager::port_name_prefix_is_unique (const string& first_part_of_port_name)
boost::shared_ptr<const Ports> pr = ports.reader();
const string::size_type len = first_part_of_port_name.length();
-
+
for (Ports::const_iterator x = pr->begin(); x != pr->end(); ++x) {
string prefix = x->first.substr (0, len);
@@ -262,7 +262,7 @@ PortManager::port_renamed (const std::string& old_relative_name, const std::stri
RCUWriter<Ports> writer (ports);
boost::shared_ptr<Ports> p = writer.get_copy();
Ports::iterator x = p->find (old_relative_name);
-
+
if (x != p->end()) {
boost::shared_ptr<Port> port = x->second;
p->erase (x);
@@ -515,9 +515,9 @@ PortManager::reconnect_ports ()
if (!Profile->get_trx()) {
/* re-establish connections */
-
+
DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size()));
-
+
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
i->second->reconnect ();
}
@@ -549,7 +549,7 @@ PortManager::connect_callback (const string& a, const string& b, bool conn)
port_b, b,
conn
); /* EMIT SIGNAL */
-}
+}
void
PortManager::registration_callback ()
@@ -603,7 +603,7 @@ PortManager::port_name_size() const
if (!_backend) {
return 0;
}
-
+
return _backend->port_name_size ();
}
@@ -613,7 +613,7 @@ PortManager::my_name() const
if (!_backend) {
return string();
}
-
+
return _backend->my_name();
}
@@ -709,9 +709,9 @@ void
PortManager::check_monitoring ()
{
for (Ports::iterator i = _cycle_ports->begin(); i != _cycle_ports->end(); ++i) {
-
+
bool x;
-
+
if (i->second->last_monitor() != (x = i->second->monitoring_input ())) {
i->second->set_last_monitor (x);
/* XXX I think this is dangerous, due to
@@ -726,14 +726,14 @@ void
PortManager::fade_out (gain_t base_gain, gain_t gain_step, pframes_t nframes)
{
for (Ports::iterator i = _cycle_ports->begin(); i != _cycle_ports->end(); ++i) {
-
+
if (i->second->sends_output()) {
-
+
boost::shared_ptr<AudioPort> ap = boost::dynamic_pointer_cast<AudioPort> (i->second);
if (ap) {
Sample* s = ap->engine_get_whole_audio_buffer ();
gain_t g = base_gain;
-
+
for (pframes_t n = 0; n < nframes; ++n) {
*s++ *= g;
g -= gain_step;
diff --git a/libs/ardour/port_set.cc b/libs/ardour/port_set.cc
index 3489ae4e44..93fe54ed1c 100644
--- a/libs/ardour/port_set.cc
+++ b/libs/ardour/port_set.cc
@@ -92,7 +92,7 @@ PortSet::add (boost::shared_ptr<Port> port)
sort(v.begin(), v.end(), sort_ports_by_name);
sort(_all_ports.begin(), _all_ports.end(), sort_ports_by_type_and_name);
-
+
_count.set(port->type(), _count.get(port->type()) + 1);
assert(_count.get(port->type()) == _ports[port->type()].size());
}
@@ -104,7 +104,7 @@ PortSet::remove (boost::shared_ptr<Port> port)
if (i != _all_ports.end()) {
_all_ports.erase(i);
}
-
+
for (std::vector<PortVec>::iterator l = _ports.begin(); l != _ports.end(); ++l) {
PortVec::iterator i = find(l->begin(), l->end(), port);
if (i != l->end()) {
diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc
index aca9ccaab1..315fb6662e 100644
--- a/libs/ardour/processor.cc
+++ b/libs/ardour/processor.cc
@@ -139,15 +139,15 @@ Processor::set_state_2X (const XMLNode & node, int /*version*/)
XMLProperty const * prop;
XMLNodeList children = node.children ();
-
+
for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == X_("IO")) {
-
+
if ((prop = (*i)->property ("name")) != 0) {
set_name (prop->value ());
}
-
+
set_id (**i);
//note: in A2, active state was stored in the Redirect node, not the child IO node
@@ -162,7 +162,7 @@ Processor::set_state_2X (const XMLNode & node, int /*version*/)
}
}
}*/
-
+
}
}
@@ -188,7 +188,7 @@ Processor::set_state (const XMLNode& node, int version)
*/
Processor::set_name (prop->value());
}
-
+
set_id (node);
}
diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc
index cc5b3c53c2..f484a1602a 100644
--- a/libs/ardour/quantize.cc
+++ b/libs/ardour/quantize.cc
@@ -99,7 +99,7 @@ swing_position (double pos, double grid, double swing, double offset)
/* now correct for start-of-model offset */
pos += offset;
-
+
if (fabs (pos - swung_pos) > fabs (pos - swung_previous_grid_position)) {
pos = swung_previous_grid_position;
} else {
@@ -135,7 +135,7 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model,
* these versions of new_start and new_end are
* guaranteed to precisely align with the quantize grid(s).
*/
-
+
double new_start = round (((*i)->time().to_double() - offset) / _start_grid) * _start_grid;
double new_end = round (((*i)->end_time().to_double() - offset) / _end_grid) * _end_grid;
@@ -143,7 +143,7 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model,
new_start = swing_position (new_start, _start_grid, _swing, offset);
new_end = swing_position (new_end, _end_grid, _swing, offset);
-
+
} else {
/* now correct for start-of-model offset */
@@ -151,10 +151,10 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model,
new_start += offset;
new_end += offset;
}
-
+
double delta = new_start - (*i)->time().to_double();
-
+
if (fabs (delta) >= _threshold) {
if (_snap_start) {
delta *= _strength;
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 813fb93584..bf01238fb4 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -599,7 +599,7 @@ Region::set_position_internal (framepos_t pos, bool allow_bbt_recompute)
e.g. Playlist::notify_region_moved doesn't use an out-of-date last_position.
*/
_last_position = _position;
-
+
if (_position != pos) {
_position = pos;
@@ -1738,4 +1738,4 @@ Region::latest_possible_frame () const
return _position + (minlen - _start) - 1;
}
-
+
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc
index 7c9f4fd228..33c714cd1d 100644
--- a/libs/ardour/region_factory.cc
+++ b/libs/ardour/region_factory.cc
@@ -83,7 +83,7 @@ RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
if (ret) {
ret->set_name (new_region_name(ret->name()));
ret->set_position (region->position());
-
+
if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
ret->set_position_lock_style (MusicTime);
}
@@ -129,7 +129,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, const PropertyList& pli
if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
ret->set_position_lock_style (MusicTime);
}
-
+
if (announce) {
map_add (ret);
CheckNewRegion (ret);
@@ -255,7 +255,7 @@ RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool a
if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
ret->set_position_lock_style (MusicTime);
}
-
+
if (announce) {
map_add (ret);
CheckNewRegion (ret);
@@ -302,7 +302,7 @@ RegionFactory::create (SourceList& srcs, const XMLNode& node)
/* Don't fiddle with position_lock_style here as the region
description is coming from XML.
*/
-
+
CheckNewRegion (ret);
}
}
@@ -342,7 +342,7 @@ RegionFactory::map_remove (boost::weak_ptr<Region> w)
if (!r) {
return;
}
-
+
Glib::Threads::Mutex::Lock lm (region_map_lock);
RegionMap::iterator i = region_map.find (r->id());
@@ -449,7 +449,7 @@ RegionFactory::rename_in_region_name_maps (boost::shared_ptr<Region> region)
update_region_name_number_map (region);
Glib::Threads::Mutex::Lock lm (region_name_maps_mutex);
-
+
map<string, PBD::ID>::iterator i = region_name_map.begin();
while (i != region_name_map.end() && i->second != region->id ()) {
++i;
@@ -652,7 +652,7 @@ RegionFactory::remove_regions_using_source (boost::shared_ptr<Source> src)
RegionMap::iterator j = i;
++j;
-
+
if (i->second->uses_source (src)) {
remove_from_region_name_map (i->second->name ());
region_map.erase (i);
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 74c00409c7..2cafba5810 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -501,11 +501,11 @@ Route::process_output_buffers (BufferSet& bufs,
on a transition between monitoring states we get a de-clicking gain
change in the _main_outs delivery, if config.get_use_monitor_fades()
is true.
-
+
We override this in the case where we have an internal generator.
*/
bool silence = _have_internal_generator ? false : (monitoring_state () == MonitoringSilence);
-
+
_main_outs->no_outs_cuz_we_no_monitor (silence);
/* -------------------------------------------------------------------------------------------
@@ -1004,28 +1004,28 @@ Route::set_solo_isolated (bool yn, void *src)
}
}
-
+
if (!changed) {
return;
}
-
+
/* forward propagate solo-isolate status to everything fed by this route, but not those via sends only */
boost::shared_ptr<RouteList> routes = _session.get_routes ();
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
-
+
if ((*i).get() == this || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
continue;
}
-
+
bool sends_only;
bool does_feed = feeds (*i, &sends_only);
-
+
if (does_feed && !sends_only) {
(*i)->mod_solo_isolated_by_upstream (yn, src);
}
}
-
+
/* XXX should we back-propagate as well? (April 2010: myself and chris goddard think not) */
solo_isolated_changed (src);
@@ -1081,7 +1081,7 @@ Route::muted_by_others () const
//master is never muted by others
if (is_master())
return false;
-
+
//now check to see if something is soloed (and I am not)
return (_session.soloing() && !self_soloed() && !solo_isolated());
}
@@ -1108,7 +1108,7 @@ Route::before_processor_for_placement (Placement p)
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator loc;
-
+
if (p == PreFader) {
/* generic pre-fader: insert immediately before the amp */
loc = find (_processors.begin(), _processors.end(), _amp);
@@ -1131,14 +1131,14 @@ Route::before_processor_for_index (int index)
}
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
-
+
ProcessorList::iterator i = _processors.begin ();
int j = 0;
while (i != _processors.end() && j < index) {
if ((*i)->display_to_user()) {
++j;
}
-
+
++i;
}
@@ -1321,7 +1321,7 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
if (processor->set_state (node, version)) {
return false;
}
-
+
//A2 uses the "active" flag in the toplevel redirect node, not in the child plugin/IO
if (i != children.end()) {
if ((prop = (*i)->property (X_("active"))) != 0) {
@@ -1995,12 +1995,12 @@ Route::all_visible_processors_active (bool state)
if (_processors.empty()) {
return;
}
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (!(*i)->display_to_user() || boost::dynamic_pointer_cast<Amp> (*i)) {
continue;
}
-
+
if (state) {
(*i)->activate ();
} else {
@@ -3105,9 +3105,9 @@ Route::remove_aux_or_listen (boost::shared_ptr<Route> route)
again:
for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ++x) {
-
+
boost::shared_ptr<InternalSend> d = boost::dynamic_pointer_cast<InternalSend>(*x);
-
+
if (d && d->target_route() == route) {
rl.release ();
if (remove_processor (*x, &err, false) > 0) {
@@ -3571,9 +3571,9 @@ Route::set_meter_point_unlocked ()
/* Set up the meter for its new position */
ProcessorList::iterator loc = find (_processors.begin(), _processors.end(), _meter);
-
+
ChanCount m_in;
-
+
if (loc == _processors.begin()) {
m_in = _input->n_ports();
} else {
@@ -3976,7 +3976,7 @@ Route::set_name_in_state (XMLNode& node, string const & name)
XMLNodeList children = node.children();
for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
-
+
if ((*i)->name() == X_("IO")) {
IO::set_name_in_state (**i, name);
@@ -3987,12 +3987,12 @@ Route::set_name_in_state (XMLNode& node, string const & name)
if (role && role->value() == X_("Main")) {
(*i)->add_property (X_("name"), name);
}
-
+
} else if ((*i)->name() == X_("Diskstream")) {
(*i)->add_property (X_("playlist"), string_compose ("%1.1", name).c_str());
(*i)->add_property (X_("name"), name);
-
+
}
}
}
@@ -4278,17 +4278,17 @@ Route::update_port_latencies (PortSet& from, PortSet& to, bool playback, framecn
} else {
all_connections.min = ~((pframes_t) 0);
all_connections.max = 0;
-
+
/* iterate over all "from" ports and determine the latency range for all of their
connections to the "outside" (outside of this Route).
*/
-
+
for (PortSet::iterator p = from.begin(); p != from.end(); ++p) {
-
+
LatencyRange range;
-
+
p->get_connected_latency_range (range, playback);
-
+
all_connections.min = min (all_connections.min, range.min);
all_connections.max = max (all_connections.max, range.max);
}
@@ -4581,7 +4581,7 @@ Route::maybe_note_meter_position ()
if (_meter_point != MeterCustom) {
return;
}
-
+
_custom_meter_position_noted = true;
/* custom meter points range from after trim to before panner/main_outs
* this is a limitation by the current processor UI
@@ -4650,7 +4650,7 @@ Route::has_external_redirects () const
/* ignore inactive processors and obviously ignore the main
* outs since everything has them and we don't care.
*/
-
+
if ((*i)->active() && (*i) != _main_outs && (*i)->does_routing()) {
return true;;
}
@@ -4696,7 +4696,7 @@ Route::non_realtime_locate (framepos_t pos)
{
//Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->transport_located (pos);
}
@@ -4709,7 +4709,7 @@ Route::fill_buffers_with_input (BufferSet& bufs, boost::shared_ptr<IO> io, pfram
{
size_t n_buffers;
size_t i;
-
+
/* MIDI
*
* We don't currently mix MIDI input together, so we don't need the
@@ -4722,7 +4722,7 @@ Route::fill_buffers_with_input (BufferSet& bufs, boost::shared_ptr<IO> io, pfram
boost::shared_ptr<MidiPort> source_port = io->midi (i);
MidiBuffer& buf (bufs.get_midi (i));
-
+
if (source_port) {
buf.copy (source_port->get_midi_buffer(nframes));
} else {
@@ -4740,19 +4740,19 @@ Route::fill_buffers_with_input (BufferSet& bufs, boost::shared_ptr<IO> io, pfram
if (n_ports > n_buffers) {
scaling = ((float) n_buffers) / n_ports;
}
-
+
for (i = 0; i < n_ports; ++i) {
-
+
/* if there are more ports than buffers, map them onto buffers
* in a round-robin fashion
*/
boost::shared_ptr<AudioPort> source_port = io->audio (i);
AudioBuffer& buf (bufs.get_audio (i%n_buffers));
-
+
if (i < n_buffers) {
-
+
/* first time through just copy a channel into
the output buffer.
*/
@@ -4762,9 +4762,9 @@ Route::fill_buffers_with_input (BufferSet& bufs, boost::shared_ptr<IO> io, pfram
if (scaling != 1.0f) {
buf.apply_gain (scaling, nframes);
}
-
+
} else {
-
+
/* on subsequent times around, merge data from
* the port with what is already there
*/
diff --git a/libs/ardour/route_graph.cc b/libs/ardour/route_graph.cc
index ee02afef24..ab88a0d839 100644
--- a/libs/ardour/route_graph.cc
+++ b/libs/ardour/route_graph.cc
@@ -70,7 +70,7 @@ GraphEdges::has (GraphVertex from, GraphVertex to, bool* via_sends_only)
if (i == _from_to_with_sends.end ()) {
return false;
}
-
+
if (via_sends_only) {
*via_sends_only = i->second.second;
}
@@ -86,7 +86,7 @@ GraphEdges::from (GraphVertex r) const
if (i == _from_to.end ()) {
return set<GraphVertex> ();
}
-
+
return i->second;
}
@@ -99,7 +99,7 @@ GraphEdges::remove (GraphVertex from, GraphVertex to)
if (i->second.empty ()) {
_from_to.erase (i);
}
-
+
EdgeMap::iterator j = _to_from.find (to);
assert (j != _to_from.end ());
j->second.erase (from);
@@ -139,7 +139,7 @@ GraphEdges::dump () const
}
cout << "\n";
}
-
+
for (EdgeMap::const_iterator i = _to_from.begin(); i != _to_from.end(); ++i) {
cout << "TO: " << i->first->name() << " ";
for (set<GraphVertex>::const_iterator j = i->second.begin(); j != i->second.end(); ++j) {
@@ -197,7 +197,7 @@ ARDOUR::topological_sort (
)
{
boost::shared_ptr<RouteList> sorted_routes (new RouteList);
-
+
/* queue of routes to process */
RouteList queue;
@@ -217,7 +217,7 @@ ARDOUR::topological_sort (
/* Do the sort: algorithm is Kahn's from Wikipedia.
`Topological sorting of large networks', Communications of the ACM 5(11):558-562.
*/
-
+
while (!queue.empty ()) {
GraphVertex r = queue.front ();
queue.pop_front ();
diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc
index 42909ee497..032c85f6ce 100644
--- a/libs/ardour/route_group.cc
+++ b/libs/ardour/route_group.cc
@@ -136,7 +136,7 @@ RouteGroup::add (boost::shared_ptr<Route> r)
if (r->route_group()) {
r->route_group()->remove (r);
}
-
+
routes->push_back (r);
r->set_route_group (this);
@@ -190,7 +190,7 @@ RouteGroup::get_min_factor (gain_t factor)
factor = 0.0000003f / g - 1.0f;
}
-
+
return factor;
}
diff --git a/libs/ardour/search_paths.cc b/libs/ardour/search_paths.cc
index 1089a3cd82..50ecac613e 100644
--- a/libs/ardour/search_paths.cc
+++ b/libs/ardour/search_paths.cc
@@ -64,7 +64,7 @@ control_protocol_search_path ()
Searchpath spath(user_config_directory ());
spath += ardour_dll_directory ();
spath.add_subdirectory_to_paths (surfaces_dir_name);
-
+
spath += Searchpath(Glib::getenv(surfaces_env_variable_name));
return spath;
}
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index 3036c0b41e..ec86686bef 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -68,7 +68,7 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_b
abort(); /*NOTREACHED*/
return string();
}
-
+
}
Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMaster> mm, Role r, bool ignore_bitslot)
@@ -239,7 +239,7 @@ Send::set_state (const XMLNode& node, int version)
/* don't try to reset bitslot if there is a node for it already: this can cause
issues with the session's accounting of send ID's
*/
-
+
if ((prop = node.property ("bitslot")) == 0) {
if (_role == Delivery::Aux) {
_bitslot = _session.next_aux_send_id ();
@@ -264,7 +264,7 @@ Send::set_state (const XMLNode& node, int version)
}
}
}
-
+
XMLNodeList nlist = node.children();
for (XMLNodeIterator i = nlist.begin(); i != nlist.end(); ++i) {
if ((*i)->name() == X_("Processor")) {
@@ -401,4 +401,4 @@ Send::value_as_string (boost::shared_ptr<AutomationControl> ac) const
return _amp->value_as_string (ac);
}
-
+
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index eb333f8e0d..879bd76539 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -211,7 +211,7 @@ Session::Session (AudioEngine &eng,
, loop_changing (false)
, last_loopend (0)
, _session_dir (new SessionDirectory (fullpath))
- , _current_snapshot_name (snapshot_name)
+ , _current_snapshot_name (snapshot_name)
, state_tree (0)
, state_was_pending (false)
, _state_of_the_state (StateOfTheState(CannotSave|InitialConnecting|Loading))
@@ -304,12 +304,12 @@ Session::Session (AudioEngine &eng,
pthread_cond_init (&_rt_emit_cond, 0);
pre_engine_init (fullpath);
-
+
if (_is_new) {
Stateful::loading_state_version = CURRENT_SESSION_FILE_VERSION;
-#ifdef USE_TRACKS_CODE_FEATURES
+#ifdef USE_TRACKS_CODE_FEATURES
sr = EngineStateController::instance()->get_current_sample_rate();
#endif
if (ensure_engine (sr)) {
@@ -348,7 +348,7 @@ Session::Session (AudioEngine &eng,
if (load_state (_current_snapshot_name)) {
throw SessionException (_("Failed to load state"));
}
-
+
/* try to get sample rate from XML state so that we
* can influence the SR if we set up the audio
* engine.
@@ -356,7 +356,7 @@ Session::Session (AudioEngine &eng,
if (state_tree) {
const XMLProperty* prop;
- if ((prop = state_tree->root()->property (X_("sample-rate"))) != 0) {
+ if ((prop = state_tree->root()->property (X_("sample-rate"))) != 0) {
sr = atoi (prop->value());
}
}
@@ -398,25 +398,25 @@ Session::Session (AudioEngine &eng,
_engine.reset_timebase ();
#ifdef USE_TRACKS_CODE_FEATURES
-
+
EngineStateController::instance()->set_session(this);
-
+
if (_is_new ) {
if ( ARDOUR::Profile->get_trx () ) {
/* Waves Tracks: fill session with tracks basing on the amount of inputs.
* each available input must have corresponding track when session starts.
*/
-
+
uint32_t how_many (0);
-
+
std::vector<std::string> inputs;
EngineStateController::instance()->get_physical_audio_inputs(inputs);
-
+
how_many = inputs.size();
-
+
list<boost::shared_ptr<AudioTrack> > tracks;
-
+
// Track names after driver
if (Config->get_tracks_auto_naming() == NameAfterDriver) {
string track_name = "";
@@ -424,14 +424,14 @@ Session::Session (AudioEngine &eng,
string track_name;
track_name = inputs[i];
replace_all (track_name, "system:capture", "");
-
+
list<boost::shared_ptr<AudioTrack> > single_track = new_audio_track (1, 1, Normal, 0, 1, track_name);
tracks.insert(tracks.begin(), single_track.front());
}
} else { // Default track names
tracks = new_audio_track (1, 1, Normal, 0, how_many, string());
}
-
+
if (tracks.size() != how_many) {
destroy ();
throw failed_constructor ();
@@ -439,7 +439,7 @@ Session::Session (AudioEngine &eng,
}
}
#endif
-
+
_is_new = false;
session_loaded ();
@@ -448,9 +448,9 @@ Session::Session (AudioEngine &eng,
Session::~Session ()
{
-#ifdef PT_TIMING
+#ifdef PT_TIMING
ST.dump ("ST.dump");
-#endif
+#endif
destroy ();
}
@@ -493,7 +493,7 @@ Session::immediately_post_engine ()
* know that the engine is running, but before we either create a
* session or set state for an existing one.
*/
-
+
if (how_many_dsp_threads () > 1) {
/* For now, only create the graph if we are using >1 DSP threads, as
it is a bit slower than the old code with 1 thread.
@@ -553,9 +553,9 @@ Session::destroy ()
/* shutdown control surface protocols while we still have ports
and the engine to move data to any devices.
*/
-
+
ControlProtocolManager::instance().drop_protocols ();
-
+
_engine.remove_session ();
#ifdef USE_TRACKS_CODE_FEATURES
@@ -586,7 +586,7 @@ Session::destroy ()
_butler->drop_references ();
delete _butler;
_butler = 0;
-
+
delete _all_route_group;
DEBUG_TRACE (DEBUG::Destruction, "delete route groups\n");
@@ -675,7 +675,7 @@ Session::destroy ()
delete _locations; _locations = 0;
delete _tempo_map;
-
+
DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n");
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
@@ -687,10 +687,10 @@ void
Session::setup_ltc ()
{
XMLNode* child = 0;
-
+
_ltc_input.reset (new IO (*this, X_("LTC In"), IO::Input));
_ltc_output.reset (new IO (*this, X_("LTC Out"), IO::Output));
-
+
if (state_tree && (child = find_named_node (*state_tree->root(), X_("LTC In"))) != 0) {
_ltc_input->set_state (*(child->children().front()), Stateful::loading_state_version);
} else {
@@ -700,7 +700,7 @@ Session::setup_ltc ()
}
reconnect_ltc_input ();
}
-
+
if (state_tree && (child = find_named_node (*state_tree->root(), X_("LTC Out"))) != 0) {
_ltc_output->set_state (*(child->children().front()), Stateful::loading_state_version);
} else {
@@ -710,11 +710,11 @@ Session::setup_ltc ()
}
reconnect_ltc_output ();
}
-
+
/* fix up names of LTC ports because we don't want the normal
* IO style of NAME/TYPE-{in,out}N
*/
-
+
_ltc_input->nth (0)->set_name (X_("LTC-in"));
_ltc_output->nth (0)->set_name (X_("LTC-out"));
}
@@ -735,11 +735,11 @@ Session::setup_click ()
void
Session::setup_click_state (const XMLNode* node)
-{
+{
const XMLNode* child = 0;
-
+
if (node && (child = find_named_node (*node, "Click")) != 0) {
-
+
/* existing state for Click */
int c = 0;
@@ -755,7 +755,7 @@ Session::setup_click_state (const XMLNode* node)
}
}
}
-
+
if (c == 0) {
_clicking = Config->get_clicking ();
@@ -929,7 +929,7 @@ Session::auto_connect_master_bus ()
if (!_master_out || !Config->get_auto_connect_standard_busses() || _monitor_out) {
return;
}
-
+
// Waves Tracks: Do not connect master bas for Tracks if AutoConnectMaster option is not set
// In this case it means "Multi Out" output mode
if (ARDOUR::Profile->get_trx() && !(Config->get_output_auto_connect() & AutoConnectMaster) ) {
@@ -938,21 +938,21 @@ Session::auto_connect_master_bus ()
/* if requested auto-connect the outputs to the first N physical ports.
*/
-
+
uint32_t limit = _master_out->n_outputs().n_total();
vector<string> outputs[DataType::num_types];
-
+
for (uint32_t i = 0; i < DataType::num_types; ++i) {
_engine.get_physical_outputs (DataType (DataType::Symbol (i)), outputs[i]);
}
-
+
for (uint32_t n = 0; n < limit; ++n) {
boost::shared_ptr<Port> p = _master_out->output()->nth (n);
string connect_to;
if (outputs[p->type()].size() > n) {
connect_to = outputs[p->type()][n];
}
-
+
if (!connect_to.empty() && p->connected_to (connect_to) == false) {
if (_master_out->output()->connect (p, connect_to, this)) {
error << string_compose (_("cannot connect master output %1 to %2"), n, connect_to)
@@ -983,20 +983,20 @@ Session::remove_monitor_section ()
/* Hold process lock while doing this so that we don't hear bits and
* pieces of audio as we work on each route.
*/
-
+
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
-
+
/* Connect tracks to monitor section. Note that in an
existing session, the internal sends will already exist, but we want the
routes to notice that they connect to the control out specifically.
*/
-
-
+
+
boost::shared_ptr<RouteList> r = routes.reader ();
PBD::Unwinder<bool> uw (ignore_route_processor_changes, true);
-
+
for (RouteList::iterator x = r->begin(); x != r->end(); ++x) {
-
+
if ((*x)->is_monitor()) {
/* relax */
} else if ((*x)->is_master()) {
@@ -1044,17 +1044,17 @@ Session::add_monitor_section ()
rl.push_back (r);
add_routes (rl, false, false, false);
-
+
assert (_monitor_out);
/* AUDIO ONLY as of june 29th 2009, because listen semantics for anything else
are undefined, at best.
*/
-
+
uint32_t limit = _monitor_out->n_inputs().n_audio();
-
+
if (_master_out) {
-
+
/* connect the inputs to the master bus outputs. this
* represents a separate data feed from the internal sends from
* each route. as of jan 2011, it allows the monitor section to
@@ -1068,7 +1068,7 @@ Session::add_monitor_section ()
for (uint32_t n = 0; n < limit; ++n) {
boost::shared_ptr<AudioPort> p = _monitor_out->input()->ports().nth_audio_port (n);
boost::shared_ptr<AudioPort> o = _master_out->output()->ports().nth_audio_port (n);
-
+
if (o) {
string connect_to = o->name();
if (_monitor_out->input()->connect (p, connect_to, this)) {
@@ -1079,16 +1079,16 @@ Session::add_monitor_section ()
}
}
}
-
+
/* if monitor section is not connected, connect it to physical outs
*/
-
+
if (Config->get_auto_connect_standard_busses() && !_monitor_out->output()->connected ()) {
-
+
if (!Config->get_monitor_bus_preferred_bundle().empty()) {
-
+
boost::shared_ptr<Bundle> b = bundle_by_name (Config->get_monitor_bus_preferred_bundle());
-
+
if (b) {
_monitor_out->output()->connect_ports_to_bundle (b, true, this);
} else {
@@ -1096,9 +1096,9 @@ Session::add_monitor_section ()
Config->get_monitor_bus_preferred_bundle())
<< endmsg;
}
-
+
} else {
-
+
/* Monitor bus is audio only */
vector<string> outputs[DataType::num_types];
@@ -1109,17 +1109,17 @@ Session::add_monitor_section ()
uint32_t mod = outputs[DataType::AUDIO].size();
uint32_t limit = _monitor_out->n_outputs().get (DataType::AUDIO);
-
+
if (mod != 0) {
-
+
for (uint32_t n = 0; n < limit; ++n) {
-
+
boost::shared_ptr<Port> p = _monitor_out->output()->ports().port(DataType::AUDIO, n);
string connect_to;
if (outputs[DataType::AUDIO].size() > (n % mod)) {
connect_to = outputs[DataType::AUDIO][n % mod];
}
-
+
if (!connect_to.empty()) {
if (_monitor_out->output()->connect (p, connect_to, this)) {
error << string_compose (
@@ -1137,7 +1137,7 @@ Session::add_monitor_section ()
/* Hold process lock while doing this so that we don't hear bits and
* pieces of audio as we work on each route.
*/
-
+
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
/* Connect tracks to monitor section. Note that in an
@@ -1151,7 +1151,7 @@ Session::add_monitor_section ()
PBD::Unwinder<bool> uw (ignore_route_processor_changes, true);
for (RouteList::iterator x = rls->begin(); x != rls->end(); ++x) {
-
+
if ((*x)->is_monitor()) {
/* relax */
} else if ((*x)->is_master()) {
@@ -1482,7 +1482,7 @@ Session::auto_loop_changed (Location* location)
}
}
-
+
last_loopend = location->end();
set_dirty ();
}
@@ -1532,14 +1532,14 @@ Session::set_session_extents (framepos_t start, framepos_t end)
//if there is no existing session, we need to make a new session location (should never happen)
existing = new Location (*this, 0, 0, _("session"), Location::IsSessionRange);
}
-
+
if (end <= start) {
error << _("Session: you can't use that location for session start/end)") << endmsg;
return;
}
existing->set( start, end );
-
+
set_dirty();
}
@@ -1613,7 +1613,7 @@ Session::update_skips (Location* loc, bool consolidate)
if (_ignore_skips_updates) {
return;
}
-
+
Locations::LocationList skips;
if (consolidate) {
@@ -1683,9 +1683,9 @@ Session::_sync_locations_to_skips ()
Locations::LocationList const & locs (_locations->list());
for (Locations::LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) {
-
+
Location* location = *i;
-
+
if (location->is_skip() && location->is_skipping()) {
SessionEvent* ev = new SessionEvent (SessionEvent::Skip, SessionEvent::Add, location->start(), location->end(), 1.0);
queue_event (ev);
@@ -1774,14 +1774,14 @@ Session::_locations_changed (const Locations::LocationList& locations)
We might be re-adding a location here but it doesn't actually matter
for all the locations that the Session takes an interest in.
*/
-
+
{
PBD::Unwinder<bool> protect_ignore_skip_updates (_ignore_skips_updates, true);
for (Locations::LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
location_added (*i);
}
}
-
+
update_skips (NULL, false);
}
@@ -1799,7 +1799,7 @@ Session::enable_record ()
if (rs == Recording) {
break;
}
-
+
if (g_atomic_int_compare_and_exchange (&_record_status, rs, Recording)) {
_last_record_location = _transport_frame;
@@ -1961,7 +1961,7 @@ Session::set_frame_rate (framecnt_t frames_per_second)
clear_clicks ();
reset_write_sources (false);
-
+
// XXX we need some equivalent to this, somehow
// SndFileSource::setup_standard_crossfades (frames_per_second);
@@ -1978,7 +1978,7 @@ Session::set_block_size (pframes_t nframes)
::process(). It is therefore fine to do things that block
here.
*/
-
+
{
current_block_size = nframes;
@@ -2101,7 +2101,7 @@ Session::resort_routes_using (boost::shared_ptr<RouteList> r)
/* We are going to build a directed graph of our routes;
this is where the edges of that graph are put.
*/
-
+
GraphEdges edges;
/* Go through all routes doing two things:
@@ -2114,7 +2114,7 @@ Session::resort_routes_using (boost::shared_ptr<RouteList> r)
* routes directly or indirectly feed them. This information
* is used by the solo code.
*/
-
+
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
/* Clear out the route's list of direct or indirect feeds */
@@ -2138,7 +2138,7 @@ Session::resort_routes_using (boost::shared_ptr<RouteList> r)
/* Attempt a topological sort of the route graph */
boost::shared_ptr<RouteList> sorted_routes = topological_sort (r, edges);
-
+
if (sorted_routes) {
/* We got a satisfactory topological sort, so there is no feedback;
use this new graph.
@@ -2149,7 +2149,7 @@ Session::resort_routes_using (boost::shared_ptr<RouteList> r)
if (_process_graph) {
_process_graph->rechain (sorted_routes, edges);
}
-
+
_current_route_graph = edges;
/* Complete the building of the routes' lists of what directly
@@ -2180,7 +2180,7 @@ Session::resort_routes_using (boost::shared_ptr<RouteList> r)
so the solo code will think that everything is still connected
as it was before.
*/
-
+
FeedbackDetected (); /* EMIT SIGNAL */
}
@@ -2205,7 +2205,7 @@ Session::find_route_name (string const & base, uint32_t& id, string& name, bool
routes, but hidden objects like the click track. So check port names
before anything else.
*/
-
+
for (vector<string>::const_iterator reserved = reserved_io_names.begin(); reserved != reserved_io_names.end(); ++reserved) {
if (base == *reserved) {
definitely_add_number = true;
@@ -2215,7 +2215,7 @@ Session::find_route_name (string const & base, uint32_t& id, string& name, bool
break;
}
}
-
+
if (!definitely_add_number && route_by_name (base) == 0) {
/* juse use the base */
name = base;
@@ -2230,7 +2230,7 @@ Session::find_route_name (string const & base, uint32_t& id, string& name, bool
}
++id;
-
+
} while (id < (UINT_MAX-1));
return false;
@@ -2313,7 +2313,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost:
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (track->input()->ensure_io (input, false, this)) {
- error << "cannot configure " << input << " out configuration for new midi track" << endmsg;
+ error << "cannot configure " << input << " out configuration for new midi track" << endmsg;
goto failed;
}
@@ -2369,7 +2369,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost:
PluginPtr plugin = instrument->load (*this);
boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin));
(*r)->add_processor (p, PreFader);
-
+
}
}
}
@@ -2751,24 +2751,24 @@ Session::reconnect_mtc_ports ()
}
mtc_in_ptr->disconnect_all ();
-
+
std::vector<EngineStateController::MidiPortState> midi_port_states;
EngineStateController::instance()->get_physical_midi_input_states (midi_port_states);
-
+
std::vector<EngineStateController::MidiPortState>::iterator state_iter = midi_port_states.begin();
-
+
for (; state_iter != midi_port_states.end(); ++state_iter) {
if (state_iter->available && state_iter->mtc_in) {
mtc_in_ptr->connect (state_iter->name);
}
}
-
+
if (!_midi_ports->mtc_input_port ()->connected () &&
config.get_external_sync () &&
(Config->get_sync_source () == MTC) ) {
config.set_external_sync (false);
}
-
+
if ( ARDOUR::Profile->get_trx () ) {
// Tracks need this signal to update timecode_source_dropdown
MtcOrLtcInputPortChanged (); //emit signal
@@ -2827,7 +2827,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
const string name_pattern = default_track_name_pattern (DataType::AUDIO);
bool const use_number = (how_many != 1) || name_template.empty () || (name_template == name_pattern);
-
+
while (how_many) {
if (!find_route_name (name_template.empty() ? _(name_pattern.c_str()) : name_template, ++track_id, track_name, use_number)) {
@@ -2939,7 +2939,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
RouteList ret;
bool const use_number = (how_many != 1) || name_template.empty () || name_template == _("Bus");
-
+
while (how_many) {
if (!find_route_name (name_template.empty () ? _("Bus") : name_template, ++bus_id, bus_name, use_number)) {
error << "cannot find name for new audio bus" << endmsg;
@@ -2985,7 +2985,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
bus->add_internal_return ();
ret.push_back (bus);
-
+
RouteAddedOrRemoved (true); /* EMIT SIGNAL */
ARDOUR::GUIIdle ();
@@ -3064,7 +3064,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
} else {
string const route_name = node_copy.property(X_("name"))->value ();
-
+
/* generate a new name by adding a number to the end of the template name */
if (!find_route_name (route_name.c_str(), ++number, name, true)) {
fatal << _("Session: UINT_MAX routes? impossible!") << endmsg;
@@ -3085,7 +3085,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
}
}
}
-
+
boost::shared_ptr<Route> route (XMLRouteFactory (node_copy, 3000));
if (route == 0) {
@@ -3158,13 +3158,13 @@ Session::add_routes (RouteList& new_routes, bool input_auto_connect, bool output
update_latency (true);
update_latency (false);
-
+
set_dirty();
-
+
if (save) {
save_state (_current_snapshot_name);
}
-
+
reassign_track_numbers();
update_route_record_state ();
@@ -3260,8 +3260,8 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
}
if (_monitor_out && IO::connecting_legal) {
- Glib::Threads::Mutex::Lock lm (_engine.process_lock());
-
+ Glib::Threads::Mutex::Lock lm (_engine.process_lock());
+
for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
if ((*x)->is_monitor()) {
/* relax */
@@ -3579,7 +3579,7 @@ Session::route_solo_changed (bool self_solo_change, void* /*src*/, boost::weak_p
bool leave_group_alone = (rg && rg->is_active() && rg->is_solo());
if (delta == 1 && Config->get_exclusive_solo()) {
-
+
/* new solo: disable all other solos, but not the group if its solo-enabled */
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
@@ -3609,7 +3609,7 @@ Session::route_solo_changed (bool self_solo_change, void* /*src*/, boost::weak_p
in_signal_flow = false;
DEBUG_TRACE (DEBUG::Solo, string_compose ("check feed from %1\n", (*i)->name()));
-
+
if ((*i)->feeds (route, &via_sends_only)) {
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tthere is a feed from %1\n", (*i)->name()));
if (!via_sends_only) {
@@ -3623,7 +3623,7 @@ Session::route_solo_changed (bool self_solo_change, void* /*src*/, boost::weak_p
} else {
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tno feed from %1\n", (*i)->name()));
}
-
+
DEBUG_TRACE (DEBUG::Solo, string_compose ("check feed to %1\n", (*i)->name()));
if (route->feeds (*i, &via_sends_only)) {
@@ -3747,7 +3747,7 @@ Session::io_name_is_legal (const std::string& name)
return false;
}
}
-
+
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if ((*i)->name() == name) {
return false;
@@ -3782,19 +3782,19 @@ Session::set_exclusive_input_active (boost::shared_ptr<RouteList> rl, bool onoff
for (RouteList::iterator rt = rl->begin(); rt != rl->end(); ++rt) {
PortSet& ps ((*rt)->input()->ports());
-
+
for (PortSet::iterator p = ps.begin(); p != ps.end(); ++p) {
p->get_connections (connections);
}
-
+
for (vector<string>::iterator s = connections.begin(); s != connections.end(); ++s) {
routes_using_input_from (*s, rl2);
}
-
+
/* scan all relevant routes to see if others are on or off */
-
+
bool others_are_already_on = false;
-
+
for (RouteList::iterator r = rl2.begin(); r != rl2.end(); ++r) {
boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack> (*r);
@@ -3812,11 +3812,11 @@ Session::set_exclusive_input_active (boost::shared_ptr<RouteList> rl, bool onoff
mt->set_input_active (onoff);
}
}
-
+
if (flip_others) {
/* globally reverse other routes */
-
+
for (RouteList::iterator r = rl2.begin(); r != rl2.end(); ++r) {
if ((*r) != (*rt)) {
boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack> (*r);
@@ -4136,13 +4136,13 @@ Session::add_source (boost::shared_ptr<Source> source)
/* yay, new source */
boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource> (source);
-
+
if (fs) {
if (!fs->within_session()) {
ensure_search_path_includes (Glib::path_get_dirname (fs->path()), fs->type());
}
}
-
+
set_dirty();
boost::shared_ptr<AudioFileSource> afs;
@@ -4238,7 +4238,7 @@ Session::midi_source_by_path (const std::string& path) const
= boost::dynamic_pointer_cast<MidiSource>(s->second);
boost::shared_ptr<FileSource> fs
= boost::dynamic_pointer_cast<FileSource>(s->second);
-
+
if (ms && fs && fs->path() == path) {
return ms;
}
@@ -4286,9 +4286,9 @@ Session::construct_peak_filepath (const string& filepath, const bool in_session,
string session_path;
bool in_another_session = true;
-
+
if (filepath.find (interchange_dir_string) != string::npos) {
-
+
session_path = Glib::path_get_dirname (filepath); /* now ends in audiofiles */
session_path = Glib::path_get_dirname (session_path); /* now ends in session name */
session_path = Glib::path_get_dirname (session_path); /* now ends in interchange */
@@ -4305,7 +4305,7 @@ Session::construct_peak_filepath (const string& filepath, const bool in_session,
} else {
in_another_session = false;
}
-
+
if (in_another_session) {
SessionDirectory sd (session_path);
@@ -4326,7 +4326,7 @@ Session::construct_peak_filepath (const string& filepath, const bool in_session,
if (!in_session) {
path = Glib::path_get_dirname (filepath);
}
-
+
return peak_file_helper (_session_dir->peak_path(), path, Glib::path_get_basename (filepath), !old_peak_name);
}
@@ -4360,7 +4360,7 @@ Session::new_audio_source_path_for_embedded (const std::string& path)
SessionDirectory sdir (get_best_session_directory_for_new_audio());
string base = Glib::path_get_basename (path);
string newpath = Glib::build_filename (sdir.sound_path(), base);
-
+
if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) {
MD5 md5;
@@ -4368,14 +4368,14 @@ Session::new_audio_source_path_for_embedded (const std::string& path)
md5.digestString (path.c_str());
md5.writeToString ();
base = md5.digestChars;
-
+
string ext = get_suffix (path);
if (!ext.empty()) {
base += '.';
base += ext;
}
-
+
newpath = Glib::build_filename (sdir.sound_path(), base);
/* if this collides, we're screwed */
@@ -4409,7 +4409,7 @@ Session::audio_source_name_is_unique (const string& name)
uint32_t existing = 0;
for (vector<string>::const_iterator i = sdirs.begin(); i != sdirs.end(); ++i) {
-
+
/* note that we search *without* the extension so that
we don't end up both "Audio 1-1.wav" and "Audio 1-1.caf"
in the event that this new name is required for
@@ -4417,12 +4417,12 @@ Session::audio_source_name_is_unique (const string& name)
*/
const string spath = *i;
-
+
if (matching_unsuffixed_filename_exists_in (spath, name)) {
existing++;
break;
}
-
+
/* it is possible that we have the path already
* assigned to a source that has not yet been written
* (ie. the write source for a diskstream). we have to
@@ -4431,8 +4431,8 @@ Session::audio_source_name_is_unique (const string& name)
* two Sources point to the same file with different
* notions of their removability.
*/
-
-
+
+
string possible_path = Glib::build_filename (spath, name);
if (audio_source_by_path_and_channel (possible_path, 0)) {
@@ -4449,20 +4449,20 @@ Session::format_audio_source_name (const string& legalized_base, uint32_t nchan,
{
ostringstream sstr;
const string ext = native_header_format_extension (config.get_native_file_header_format(), DataType::AUDIO);
-
+
if (Profile->get_trx() && destructive) {
sstr << 'T';
sstr << setfill ('0') << setw (4) << cnt;
sstr << legalized_base;
} else {
sstr << legalized_base;
-
+
if (take_required || related_exists) {
sstr << '-';
sstr << cnt;
}
}
-
+
if (nchan == 2) {
if (chan == 0) {
sstr << "%L";
@@ -4479,7 +4479,7 @@ Session::format_audio_source_name (const string& legalized_base, uint32_t nchan,
sstr << chan+1;
}
}
-
+
sstr << ext;
return sstr.str();
@@ -4502,11 +4502,11 @@ Session::new_audio_source_path (const string& base, uint32_t nchan, uint32_t cha
for (cnt = (destructive ? ++destructive_index : 1); cnt <= limit; ++cnt) {
possible_name = format_audio_source_name (legalized, nchan, chan, destructive, take_required, cnt, some_related_source_name_exists);
-
+
if (audio_source_name_is_unique (possible_name)) {
break;
}
-
+
some_related_source_name_exists = true;
if (cnt > limit) {
@@ -4561,14 +4561,14 @@ Session::new_midi_source_path (const string& base)
vector<space_and_path>::iterator i;
uint32_t existing = 0;
-
+
for (vector<string>::const_iterator i = sdirs.begin(); i != sdirs.end(); ++i) {
snprintf (buf, sizeof(buf), "%s-%u.mid", legalized.c_str(), cnt);
possible_name = buf;
possible_path = Glib::build_filename (*i, possible_name);
-
+
if (Glib::file_test (possible_path, Glib::FILE_TEST_EXISTS)) {
existing++;
}
@@ -4618,7 +4618,7 @@ boost::shared_ptr<MidiSource>
Session::create_midi_source_for_session (string const & basic_name)
{
const string path = new_midi_source_path (basic_name);
-
+
if (!path.empty()) {
return boost::dynamic_pointer_cast<SMFSource> (
SourceFactory::createWritable (
@@ -4634,23 +4634,23 @@ Session::create_midi_source_by_stealing_name (boost::shared_ptr<Track> track)
{
/* the caller passes in the track the source will be used in,
so that we can keep the numbering sane.
-
+
Rationale: a track with the name "Foo" that has had N
captures carried out so far will ALREADY have a write source
named "Foo-N+1.mid" waiting to be used for the next capture.
-
+
If we call new_midi_source_name() we will get "Foo-N+2". But
there is no region corresponding to "Foo-N+1", so when
"Foo-N+2" appears in the track, the gap presents the user
with odd behaviour - why did it skip past Foo-N+1?
-
+
We could explain this to the user in some odd way, but
instead we rename "Foo-N+1.mid" as "Foo-N+2.mid", and then
use "Foo-N+1" here.
-
+
If that attempted rename fails, we get "Foo-N+2.mid" anyway.
*/
-
+
boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack> (track);
assert (mt);
std::string name = track->steal_write_source_name ();
@@ -4816,7 +4816,7 @@ Session::available_capture_duration ()
if (_total_free_4k_blocks_uncertain) {
return boost::optional<framecnt_t> ();
}
-
+
float sample_bytes_on_disk = 4.0; // keep gcc happy
switch (config.get_native_file_data_format()) {
@@ -5228,7 +5228,7 @@ Session::write_one_track (Track& track, framepos_t start, framepos_t end,
string path = ((track.data_type() == DataType::AUDIO)
? new_audio_source_path (legal_playlist_name, diskstream_channels.n_audio(), chan_n, false, true)
: new_midi_source_path (legal_playlist_name));
-
+
if (path.empty()) {
goto out;
}
@@ -5535,7 +5535,7 @@ Session::update_route_record_state ()
if (record_status() == Recording && record_arm_state_changed ) {
RecordArmStateChanged ();
}
-
+
}
void
@@ -6049,7 +6049,7 @@ Session::update_latency_compensation (bool force_whole_graph)
(some_track_latency_changed ? "yes" : "no")));
DEBUG_TRACE(DEBUG::Latency, "---------------------------- DONE update latency compensation\n\n");
-
+
if (some_track_latency_changed || force_whole_graph) {
_engine.update_latencies ();
}
@@ -6122,7 +6122,7 @@ Session::notify_remote_id_change ()
*/
reconnect_existing_routes(true, true);
#endif
-
+
}
void
@@ -6233,5 +6233,5 @@ Session::clear_object_selection ()
_object_selection = Evoral::Range<framepos_t> (-1,-1);
#ifdef USE_TRACKS_CODE_FEATURES
follow_playhead_priority ();
-#endif
+#endif
}
diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc
index e6e8749aec..62e13e8fc2 100644
--- a/libs/ardour/session_click.cc
+++ b/libs/ardour/session_click.cc
@@ -119,9 +119,9 @@ Session::click (framepos_t start, framecnt_t nframes)
}
copy = min (clk->duration - clk->offset, nframes - internal_offset);
-
+
memcpy (buf + internal_offset, &clk->data[clk->offset], copy * sizeof (Sample));
-
+
clk->offset += copy;
if (clk->offset >= clk->duration) {
diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc
index baea980a65..9d11cb0b91 100644
--- a/libs/ardour/session_events.cc
+++ b/libs/ardour/session_events.cc
@@ -79,7 +79,7 @@ SessionEvent::operator new (size_t)
SessionEvent* ev = static_cast<SessionEvent*> (p->alloc ());
DEBUG_TRACE (DEBUG::SessionEvents, string_compose ("%1 Allocating SessionEvent from %2 ev @ %3 pool size %4 free %5 used %6\n", pthread_name(), p->name(), ev,
p->total(), p->available(), p->used()));
-
+
ev->own_pool = p;
return ev;
}
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index ecfcb98b5c..ea4a07dd1f 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -89,7 +89,7 @@ Session::pre_export ()
_exporting = true;
export_status->running = true;
export_status->Finished.connect_same_thread (*this, boost::bind (&Session::finalize_audio_export, this));
-
+
/* disable MMC output early */
_pre_export_mmc_enabled = _mmc->send_enabled ();
@@ -111,7 +111,7 @@ Session::start_audio_export (framepos_t position)
up otherwise it could be doing do_refill in its thread while we are doing
it here.
*/
-
+
_butler->wait_until_finished ();
/* get everyone to the right position */
@@ -198,7 +198,7 @@ Session::process_export_fw (pframes_t nframes)
post_transport ();
return 0;
}
-
+
_engine.main_thread()->get_buffers ();
process_export (nframes);
_engine.main_thread()->drop_buffers ();
@@ -235,7 +235,7 @@ Session::finalize_audio_export ()
_engine.freewheel (false);
export_freewheel_connection.disconnect();
-
+
_mmc->enable_send (_pre_export_mmc_enabled);
/* maybe write CUE/TOC */
diff --git a/libs/ardour/session_metadata.cc b/libs/ardour/session_metadata.cc
index 017f8b95e5..0620f12005 100644
--- a/libs/ardour/session_metadata.cc
+++ b/libs/ardour/session_metadata.cc
@@ -86,7 +86,7 @@ SessionMetadata::SessionMetadata ()
//map.insert (Property ("album_artist_sort", ""));
//map.insert (Property ("artist_sort", ""));
//map.insert (Property ("title_sort", ""));
-
+
/*** Globals ***/
user_map.insert (Property ("user_name", ""));
user_map.insert (Property ("user_email", ""));
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index df2152192c..f1faf5e8e1 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -136,7 +136,7 @@ Session::mmc_record_strobe (MIDI::MachineControl &/*mmc*/)
treat RecordStrobe like RecordPause. This violates the MMC
specification.
*/
-
+
if (Config->get_mmc_control()) {
maybe_enable_record();
}
@@ -438,7 +438,7 @@ Session::send_full_time_code (framepos_t const t, MIDI::pframes_t nframes)
msg[8] = timecode.frames;
// Send message at offset 0, sent time is for the start of this cycle
-
+
MidiBuffer& mb (_midi_ports->mtc_output_port()->get_midi_buffer (nframes));
mb.push_back (Port::port_offset(), sizeof (msg), msg);
@@ -576,7 +576,7 @@ Session::send_immediate_mmc (MachineControlCommand c)
} else {
_mmc->send (c, 0);
}
-
+
}
bool
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc
index b586ab196e..8fdafad09d 100644
--- a/libs/ardour/session_playlists.cc
+++ b/libs/ardour/session_playlists.cc
@@ -465,7 +465,7 @@ SessionPlaylists::playlists_for_track (boost::shared_ptr<Track> tr) const
{
vector<boost::shared_ptr<Playlist> > pl;
get (pl);
-
+
vector<boost::shared_ptr<Playlist> > pl_tr;
for (vector<boost::shared_ptr<Playlist> >::iterator i = pl.begin(); i != pl.end(); ++i) {
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index f372b8694b..6f4ae531bb 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -130,7 +130,7 @@ int
Session::no_roll (pframes_t nframes)
{
PT_TIMING_CHECK (4);
-
+
framepos_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
int ret = 0;
int declick = (config.get_use_transport_fades() ? get_transport_declick_required() : false);
@@ -179,7 +179,7 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
const framepos_t start_frame = _transport_frame;
const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
-
+
if (_process_graph) {
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
if (_process_graph->process_routes (nframes, start_frame, end_frame, declick, need_butler) < 0) {
@@ -284,7 +284,7 @@ void
Session::process_with_events (pframes_t nframes)
{
PT_TIMING_CHECK (3);
-
+
SessionEvent* ev;
pframes_t this_nframes;
framepos_t end_frame;
@@ -1221,7 +1221,7 @@ Session::compute_stop_limit () const
return max_framepos;
}
-
+
bool const punching_in = (config.get_punch_in () && _locations->auto_punch_location());
bool const punching_out = (config.get_punch_out () && _locations->auto_punch_location());
diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc
index db334932f1..745212abb4 100644
--- a/libs/ardour/session_rtevents.cc
+++ b/libs/ardour/session_rtevents.cc
@@ -248,14 +248,14 @@ Session::rt_set_record_safe (boost::shared_ptr<RouteList> rl, bool yn, bool grou
if ((*i)->is_auditioner ()) { // REQUIRES REVIEW Can audiotioner be in Record Safe mode?
continue;
}
-
+
boost::shared_ptr<Track> t;
-
+
if ((t = boost::dynamic_pointer_cast<Track>(*i)) != 0) {
t->set_record_safe (yn, (group_override ? (void*) t->route_group () : (void *) this));
}
}
-
+
set_dirty ();
}
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 0c5e3cbff5..e2d64dd2ed 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -257,11 +257,11 @@ Session::realtime_stop (bool abort, bool clear_state)
for (RouteList::iterator i = r->begin (); i != r->end(); ++i) {
(*i)->realtime_handle_transport_stopped ();
}
-
+
DEBUG_TRACE (DEBUG::Transport, string_compose ("stop complete, auto-return scheduled for return to %1\n", _requested_return_frame));
/* the duration change is not guaranteed to have happened, but is likely */
-
+
todo = PostTransportWork (todo | PostTransportDuration);
if (abort) {
@@ -286,7 +286,7 @@ Session::realtime_stop (bool abort, bool clear_state)
if (clear_state && !Config->get_loop_is_mode()) {
unset_play_loop ();
}
-
+
reset_slave_state ();
_transport_speed = 0;
@@ -321,7 +321,7 @@ Session::butler_transport_work ()
PostTransportWork ptw;
boost::shared_ptr<RouteList> r = routes.reader ();
uint64_t before;
-
+
int on_entry = g_atomic_int_get (&_butler->should_do_transport_work);
finished = true;
ptw = post_transport_work();
@@ -334,7 +334,7 @@ Session::butler_transport_work ()
if (get_play_loop() && !Config->get_seamless_loop()) {
DEBUG_TRACE (DEBUG::Butler, "flush loop recording fragment to disk\n");
-
+
/* this locate might be happening while we are
* loop recording.
*
@@ -517,13 +517,13 @@ Session::non_realtime_locate ()
} else if (loc) {
set_track_loop (false);
}
-
+
} else {
/* no more looping .. should have been noticed elsewhere */
}
-
+
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
(*i)->non_realtime_locate (_transport_frame);
@@ -555,7 +555,7 @@ Session::select_playhead_priority_target (framepos_t& jump_to)
// Next stop will put us where we need to be.
return false;
}
-
+
/* Note that the order of checking each AutoReturnTarget flag defines
the priority each flag.
@@ -569,7 +569,7 @@ Session::select_playhead_priority_target (framepos_t& jump_to)
Region Selection
Last Locate
*/
-
+
if (autoreturn & RangeSelectionStart) {
if (!_range_selection.empty()) {
jump_to = _range_selection.from;
@@ -583,13 +583,13 @@ Session::select_playhead_priority_target (framepos_t& jump_to)
}
}
}
-
+
if (jump_to < 0 && (autoreturn & Loop) && get_play_loop()) {
/* don't try to handle loop play when synced to JACK */
-
+
if (!synced_to_engine()) {
Location *location = _locations->auto_loop_location();
-
+
if (location) {
jump_to = location->start();
@@ -600,7 +600,7 @@ Session::select_playhead_priority_target (framepos_t& jump_to)
}
}
}
-
+
if (jump_to < 0 && (autoreturn & RegionSelectionStart)) {
if (!_object_selection.empty()) {
jump_to = _object_selection.from;
@@ -610,7 +610,7 @@ Session::select_playhead_priority_target (framepos_t& jump_to)
if (jump_to < 0 && (autoreturn & LastLocate)) {
jump_to = _last_roll_location;
}
-
+
return jump_to >= 0;
}
#else
@@ -804,14 +804,14 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
if (_engine.connected() && !_engine.freewheeling()) {
// need to queue this in the next RT cycle
_send_timecode_update = true;
-
+
if (!dynamic_cast<MTC_Slave*>(_slave)) {
send_immediate_mmc (MIDI::MachineControlCommand (MIDI::MachineControl::cmdStop));
/* This (::non_realtime_stop()) gets called by main
process thread, which will lead to confusion
when calling AsyncMIDIPort::write().
-
+
Something must be done. XXX
*/
send_mmc_locate (_transport_frame);
@@ -904,8 +904,8 @@ Session::unset_play_loop ()
clear_events (SessionEvent::AutoLoop);
clear_events (SessionEvent::AutoLoopDeclick);
set_track_loop (false);
-
-
+
+
if (Config->get_seamless_loop()) {
/* likely need to flush track buffers: this will locate us to wherever we are */
add_post_transport_work (PostTransportLocate);
@@ -957,7 +957,7 @@ Session::set_play_loop (bool yn, double speed)
play_loop = true;
have_looped = false;
-
+
if (loc) {
unset_play_range ();
@@ -1094,7 +1094,7 @@ void
Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool for_loop_enabled, bool force, bool with_mmc)
{
bool need_butler = false;
-
+
/* Locates for seamless looping are fairly different from other
* locates. They assume that the diskstream buffers for each track
* already have the correct data in them, and thus there is no need to
@@ -1105,7 +1105,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
DEBUG_TRACE (DEBUG::Transport, string_compose ("rt-locate to %1, roll %2 flush %3 loop-enabled %4 force %5 mmc %6\n",
target_frame, with_roll, with_flush, for_loop_enabled, force, with_mmc));
-
+
if (!force && _transport_frame == target_frame && !loop_changing && !for_loop_enabled) {
/* already at the desired position. Not forced to locate,
@@ -1155,7 +1155,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
*/
bool transport_was_stopped = !transport_rolling();
-
+
if (!transport_was_stopped && (!auto_play_legal || !config.get_auto_play()) && !with_roll && !(synced_to_engine() && play_loop) &&
(!Profile->get_trx() || !(config.get_external_sync() && !synced_to_engine()))) {
realtime_stop (false, true); // XXX paul - check if the 2nd arg is really correct
@@ -1175,7 +1175,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
add_post_transport_work (todo);
need_butler = true;
-
+
} else {
/* this is functionally what clear_clicks() does but with a tentative lock */
@@ -1215,7 +1215,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
// located outside the loop: cancel looping directly, this is called from event handling context
have_looped = false;
-
+
if (!Config->get_loop_is_mode()) {
set_play_loop (false, _transport_speed);
} else {
@@ -1246,10 +1246,10 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
}
boost::shared_ptr<RouteList> rl = routes.reader();
-
+
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
-
+
if (tr && tr->record_enabled ()) {
// tell it we've looped, so it can deal with the record state
tr->transport_looped (_transport_frame);
@@ -1321,7 +1321,7 @@ Session::set_transport_speed (double speed, framepos_t destination_frame, bool a
if (Config->get_monitoring_model() == HardwareMonitoring) {
set_track_monitor_input_status (true);
}
-
+
if (synced_to_engine ()) {
if (clear_state) {
/* do this here because our response to the slave won't
@@ -1348,7 +1348,7 @@ Session::set_transport_speed (double speed, framepos_t destination_frame, bool a
if (Config->get_loop_is_mode() && play_loop) {
Location *location = _locations->auto_loop_location();
-
+
if (location != 0) {
if (_transport_frame != location->start()) {
@@ -1468,7 +1468,7 @@ Session::stop_transport (bool abort, bool clear_state)
}
DEBUG_TRACE (DEBUG::Transport, string_compose ("stop_transport, declick required? %1\n", get_transport_declick_required()));
-
+
if (!get_transport_declick_required()) {
/* stop has not yet been scheduled */
@@ -1484,10 +1484,10 @@ Session::stop_transport (bool abort, bool clear_state)
}
SubState new_bits;
-
+
if (actively_recording() && /* we are recording */
worst_input_latency() > current_block_size) { /* input latency exceeds block size, so simple 1 cycle delay before stop is not enough */
-
+
/* we need to capture the audio that is still somewhere in the pipeline between
wherever it was generated and the process callback. This means that even though
the user (or something else) has asked us to stop, we have to roll
@@ -1497,16 +1497,16 @@ Session::stop_transport (bool abort, bool clear_state)
we still need playback to "stop" now, however, which is why we schedule
a declick below.
*/
-
+
DEBUG_TRACE (DEBUG::Transport, string_compose ("stop transport requested @ %1, scheduled for + %2 = %3, abort = %4\n",
_transport_frame, _worst_input_latency,
_transport_frame + _worst_input_latency,
abort));
-
+
SessionEvent *ev = new SessionEvent (SessionEvent::StopOnce, SessionEvent::Replace,
_transport_frame + _worst_input_latency,
0, 0, abort);
-
+
merge_event (ev);
/* request a declick at the start of the next process cycle() so that playback ceases.
@@ -1515,15 +1515,15 @@ Session::stop_transport (bool abort, bool clear_state)
does not stop the transport too early.
*/
new_bits = SubState (PendingDeclickOut|StopPendingCapture);
-
+
} else {
-
+
/* Not recording, schedule a declick in the next process() cycle and then stop at its end */
-
+
new_bits = PendingDeclickOut;
DEBUG_TRACE (DEBUG::Transport, string_compose ("stop scheduled for next process cycle @ %1\n", _transport_frame));
}
-
+
/* we'll be called again after the declick */
transport_sub_state = SubState (transport_sub_state|new_bits);
pending_abort = abort;
@@ -1533,9 +1533,9 @@ Session::stop_transport (bool abort, bool clear_state)
} else {
DEBUG_TRACE (DEBUG::Transport, "time to actually stop\n");
-
+
/* declick was scheduled, but we've been called again, which means it is really time to stop
-
+
XXX: we should probably split this off into its own method and call it explicitly.
*/
@@ -1709,7 +1709,7 @@ Session::use_sync_source (Slave* new_slave)
}
DEBUG_TRACE (DEBUG::Slave, string_compose ("set new slave to %1\n", _slave));
-
+
// need to queue this for next process() cycle
_send_timecode_update = true;
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index fe78e1fbc7..33765c3d0a 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -370,7 +370,7 @@ SMFSource::write_unlocked (const Lock& lock,
break;
}
time -= position;
-
+
ev.set(buf, size, time);
ev.set_event_type(midi_parameter_type(ev.buffer()[0]));
ev.set_id(Evoral::next_event_id());
@@ -577,7 +577,7 @@ SMFSource::safe_midi_file_extension (const string& file)
static bool compile = true;
const int nmatches = 2;
regmatch_t matches[nmatches];
-
+
if (Glib::file_test (file, Glib::FILE_TEST_EXISTS)) {
if (!Glib::file_test (file, Glib::FILE_TEST_IS_REGULAR)) {
/* exists but is not a regular file */
@@ -590,7 +590,7 @@ SMFSource::safe_midi_file_extension (const string& file)
} else {
compile = false;
}
-
+
if (regexec (&compiled_pattern, file.c_str(), nmatches, matches, 0)) {
return false;
}
@@ -787,5 +787,5 @@ SMFSource::prevent_deletion ()
_flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
}
-
-
+
+
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 769ee0d1d5..8a8e117231 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -168,7 +168,7 @@ SndFileSource::SndFileSource (Session& s, const string& path, const string& orig
fmt = SF_FORMAT_RF64;
_flags = Flag (_flags & ~Broadcast);
break;
-
+
default:
fatal << string_compose (_("programming error: %1"), X_("unsupported audio header format requested")) << endmsg;
abort(); /*NOTREACHED*/
@@ -325,7 +325,7 @@ SndFileSource::open ()
}
}
#endif
-
+
if (!_broadcast_info) {
_broadcast_info = new BroadcastInfo;
}
@@ -353,7 +353,7 @@ SndFileSource::open ()
/* Set the broadcast flag if the BWF info is already there. We need
* this when recovering or using existing files.
*/
-
+
if (bwf_info_exists) {
_flags = Flag (_flags | Broadcast);
}
@@ -380,7 +380,7 @@ SndFileSource::open ()
}
}
}
-
+
return 0;
}
@@ -401,7 +401,7 @@ framecnt_t
SndFileSource::read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const
{
assert (cnt >= 0);
-
+
framecnt_t nread;
float *ptr;
framecnt_t real_cnt;
diff --git a/libs/ardour/soundcloud_upload.cc b/libs/ardour/soundcloud_upload.cc
index c7bd4605df..8c090be03d 100644
--- a/libs/ardour/soundcloud_upload.cc
+++ b/libs/ardour/soundcloud_upload.cc
@@ -344,7 +344,7 @@ SoundcloudUploader::setcUrlOptions()
curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, errorBuffer);
// Allow redirection
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
-
+
// Allow connections to time out (without using signals)
curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, 30);
diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc
index ef0538b4d7..b9ea6ee78a 100644
--- a/libs/ardour/source.cc
+++ b/libs/ardour/source.cc
@@ -149,7 +149,7 @@ Source::set_state (const XMLNode& node, int version)
error << string_compose (_("%1: this session uses destructive tracks, which are not supported"), PROGRAM_NAME) << endmsg;
return -1;
}
-
+
if (version < 3000) {
/* a source with an XML node must necessarily already exist,
and therefore cannot be removable/writable etc. etc.; 2.X
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index 6640a2493e..76975354cb 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -164,7 +164,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
try {
boost::shared_ptr<AudioPlaylistSource> ap (new AudioPlaylistSource (s, node));
-
+
if (setup_peakfile (ap, true)) {
return boost::shared_ptr<Source>();
}
@@ -239,7 +239,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
int chn, Source::Flag flags, bool announce, bool defer_peaks)
{
if (type == DataType::AUDIO) {
-
+
if (!(flags & Destructive)) {
try {
diff --git a/libs/ardour/sse_functions_avx.cc b/libs/ardour/sse_functions_avx.cc
index 218f3f5e91..19bca8041c 100644
--- a/libs/ardour/sse_functions_avx.cc
+++ b/libs/ardour/sse_functions_avx.cc
@@ -34,7 +34,7 @@ x86_sse_avx_find_peaks(const float* buf, uint32_t nframes, float *min, float *ma
// Work input until "buf" reaches 16 byte alignment
while ( ((intptr_t)buf) % 32 != 0 && nframes > 0) {
-
+
// Load the next float into the work buffer
work = _mm256_set1_ps(*buf);
diff --git a/libs/ardour/template_utils.cc b/libs/ardour/template_utils.cc
index 70fffba680..7797440f0e 100644
--- a/libs/ardour/template_utils.cc
+++ b/libs/ardour/template_utils.cc
@@ -57,7 +57,7 @@ template_filter (const string &str, void* /*arg*/)
if (!Glib::file_test (str, Glib::FILE_TEST_IS_DIR)) {
return false;
}
-
+
return true;
}
@@ -67,7 +67,7 @@ route_template_filter (const string &str, void* /*arg*/)
if (str.find (template_suffix) == str.length() - strlen (template_suffix)) {
return true;
}
-
+
return false;
}
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index df7c1ac2e3..b3207e15a5 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -173,14 +173,14 @@ TempoSection::update_bbt_time_from_bar_offset (const Meter& meter)
}
new_start.bars = start().bars;
-
+
double ticks = BBT_Time::ticks_per_beat * meter.divisions_per_bar() * _bar_offset;
new_start.beats = (uint32_t) floor (ticks/BBT_Time::ticks_per_beat);
new_start.ticks = 0; /* (uint32_t) fmod (ticks, BBT_Time::ticks_per_beat); */
/* remember the 1-based counting properties of beats */
new_start.beats += 1;
-
+
DEBUG_TRACE (DEBUG::TempoMath, string_compose ("from bar offset %1 and dpb %2, ticks = %3->%4 beats = %5\n",
_bar_offset, meter.divisions_per_bar(), ticks, new_start.ticks, new_start.beats));
@@ -336,8 +336,8 @@ TempoMap::remove_tempo_locked (const TempoSection& tempo)
}
return false;
-}
-
+}
+
void
TempoMap::remove_meter (const MeterSection& tempo, bool complete_operation)
{
@@ -361,7 +361,7 @@ bool
TempoMap::remove_meter_locked (const MeterSection& tempo)
{
Metrics::iterator i;
-
+
for (i = metrics.begin(); i != metrics.end(); ++i) {
if (dynamic_cast<MeterSection*> (*i) != 0) {
if (tempo.frame() == (*i)->frame()) {
@@ -392,21 +392,21 @@ TempoMap::do_insert (MetricSection* section)
/* we need to (potentially) update the BBT times of tempo
sections based on this new meter.
*/
-
+
if ((section->start().beats != 1) || (section->start().ticks != 0)) {
-
+
BBT_Time corrected = section->start();
corrected.beats = 1;
corrected.ticks = 0;
-
+
warning << string_compose (_("Meter changes can only be positioned on the first beat of a bar. Moving from %1 to %2"),
section->start(), corrected) << endmsg;
-
+
section->set_start (corrected);
}
}
-
+
/* Look for any existing MetricSection that is of the same type and
in the same bar as the new one, and remove it before adding
@@ -428,12 +428,12 @@ TempoMap::do_insert (MetricSection* section)
(*i)->start().beats == section->start().beats) {
if (!(*i)->movable()) {
-
+
/* can't (re)move this section, so overwrite
* its data content (but not its properties as
* a section).
*/
-
+
*(dynamic_cast<Tempo*>(*i)) = *(dynamic_cast<Tempo*>(section));
need_add = false;
} else {
@@ -449,17 +449,17 @@ TempoMap::do_insert (MetricSection* section)
if ((*i)->start().bars == section->start().bars) {
if (!(*i)->movable()) {
-
+
/* can't (re)move this section, so overwrite
* its data content (but not its properties as
* a section
*/
-
+
*(dynamic_cast<Meter*>(*i)) = *(dynamic_cast<Meter*>(section));
need_add = false;
} else {
metrics.erase (i);
-
+
}
break;
@@ -482,7 +482,7 @@ TempoMap::do_insert (MetricSection* section)
break;
}
}
-
+
metrics.insert (i, section);
}
}
@@ -493,7 +493,7 @@ TempoMap::replace_tempo (const TempoSection& ts, const Tempo& tempo, const BBT_T
{
Glib::Threads::RWLock::WriterLock lm (lock);
TempoSection& first (first_tempo());
-
+
if (ts.start() != first.start()) {
remove_tempo_locked (ts);
add_tempo_locked (tempo, where, true);
@@ -526,45 +526,45 @@ TempoMap::add_tempo_locked (const Tempo& tempo, BBT_Time where, bool recompute)
{
/* new tempos always start on a beat */
where.ticks = 0;
-
+
TempoSection* ts = new TempoSection (where, tempo.beats_per_minute(), tempo.note_type());
-
+
/* find the meter to use to set the bar offset of this
* tempo section.
*/
-
+
const Meter* meter = &first_meter();
-
+
/* as we start, we are *guaranteed* to have m.meter and m.tempo pointing
at something, because we insert the default tempo and meter during
TempoMap construction.
-
+
now see if we can find better candidates.
*/
-
+
for (Metrics::const_iterator i = metrics.begin(); i != metrics.end(); ++i) {
-
+
const MeterSection* m;
-
+
if (where < (*i)->start()) {
break;
}
-
+
if ((m = dynamic_cast<const MeterSection*>(*i)) != 0) {
meter = m;
}
}
-
+
ts->update_bar_offset_from_bbt (*meter);
-
+
/* and insert it */
-
+
do_insert (ts);
if (recompute) {
recompute_map (false);
}
-}
+}
void
TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const BBT_Time& where)
@@ -572,7 +572,7 @@ TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const BBT_T
{
Glib::Threads::RWLock::WriterLock lm (lock);
MeterSection& first (first_meter());
-
+
if (ms.start() != first.start()) {
remove_meter_locked (ms);
add_meter_locked (meter, where, true);
@@ -594,7 +594,7 @@ TempoMap::add_meter (const Meter& meter, BBT_Time where)
add_meter_locked (meter, where, true);
}
-
+
#ifndef NDEBUG
if (DEBUG_ENABLED(DEBUG::TempoMap)) {
dump (std::cerr);
@@ -611,23 +611,23 @@ TempoMap::add_meter_locked (const Meter& meter, BBT_Time where, bool recompute)
round the start time appropriately. remember that
`where' is based on the existing tempo map, not
the result after we insert the new meter.
-
+
*/
-
+
if (where.beats != 1) {
where.beats = 1;
where.bars++;
}
-
+
/* new meters *always* start on a beat. */
where.ticks = 0;
-
+
do_insert (new MeterSection (where, meter.divisions_per_bar(), meter.note_divisor()));
if (recompute) {
recompute_map (true);
}
-
+
}
void
@@ -738,7 +738,7 @@ TempoMap::first_tempo () const
const TempoSection *t = 0;
/* CALLER MUST HOLD LOCK */
-
+
for (Metrics::const_iterator i = metrics.begin(); i != metrics.end(); ++i) {
if ((t = dynamic_cast<const TempoSection *> (*i)) != 0) {
return *t;
@@ -787,7 +787,7 @@ TempoMap::require_map_to (const BBT_Time& bbt)
*/
int additional_minutes = 1;
-
+
while (1) {
if (!_map.empty() && _map.back().bar >= (bbt.bars + 1)) {
break;
@@ -867,7 +867,7 @@ TempoMap::recompute_map (bool reassign_tempo_bbt, framepos_t end)
TempoSection* ts;
MeterSection* ms;
-
+
if ((ts = dynamic_cast<TempoSection*>(*i)) != 0) {
/* reassign the BBT time of this tempo section
@@ -915,7 +915,7 @@ TempoMap::extend_map (framepos_t end)
return;
}
- BBTPointList::const_iterator i = _map.end();
+ BBTPointList::const_iterator i = _map.end();
Metrics::iterator next_metric;
--i;
@@ -1011,12 +1011,12 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
*/
if (tempo->start().ticks != 0) {
-
- double next_beat_frames = tempo->frames_per_beat (_frame_rate);
-
+
+ double next_beat_frames = tempo->frames_per_beat (_frame_rate);
+
DEBUG_TRACE (DEBUG::TempoMath, string_compose ("bumped into non-beat-aligned tempo metric at %1 = %2, adjust next beat using %3\n",
tempo->start(), current_frame, tempo->bar_offset()));
-
+
/* back up to previous beat */
current_frame_exact -= beat_frames;
current_frame = llrint(current_frame_exact);
@@ -1027,7 +1027,7 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
*/
tempo->set_frame (bar_start_frame +
llrint ((ts->bar_offset() * meter->divisions_per_bar() * beat_frames)));
-
+
/* advance to the location of
* the new (adjusted) beat. do
* this by figuring out the
@@ -1048,35 +1048,35 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
* merit a reloop ...
*/
DEBUG_TRACE (DEBUG::TempoMath, string_compose ("Adjusted last beat to %1\n", current_frame));
-
+
} else {
-
+
DEBUG_TRACE (DEBUG::TempoMath, string_compose ("bumped into beat-aligned tempo metric at %1 = %2\n",
tempo->start(), current_frame));
tempo->set_frame (current_frame);
}
} else if ((ms = dynamic_cast<MeterSection*>(*next_metric)) != 0) {
-
+
meter = ms;
/* new meter section: always defines the
* start of a bar.
*/
-
+
DEBUG_TRACE (DEBUG::TempoMath, string_compose ("bumped into meter section at %1 vs %2 (%3)\n",
meter->start(), current, current_frame));
-
+
assert (current.beats == 1);
meter->set_frame (current_frame);
}
-
+
beat_frames = meter->frames_per_grid (*tempo, _frame_rate);
-
+
DEBUG_TRACE (DEBUG::TempoMath, string_compose ("New metric with beat frames = %1 dpb %2 meter %3 tempo %4\n",
beat_frames, meter->divisions_per_bar(), *((Meter*)meter), *((Tempo*)tempo)));
-
+
++next_metric;
if (next_metric != metrics.end() && ((*next_metric)->start() == current)) {
@@ -1133,7 +1133,7 @@ TempoMap::metric_at (framepos_t frame, Metrics::const_iterator* last) const
*last = i;
}
}
-
+
return m;
}
@@ -1190,7 +1190,7 @@ TempoMap::bbt_time_rt (framepos_t frame, BBT_Time& bbt)
if (!lm.locked()) {
throw std::logic_error ("TempoMap::bbt_time_rt() could not lock tempo map");
}
-
+
if (_map.empty() || _map.back().frame < frame) {
throw std::logic_error (string_compose ("map not long enough to reach %1", frame));
}
@@ -1221,7 +1221,7 @@ TempoMap::frame_time (const BBT_Time& bbt)
warning << string_compose (_("tempo map asked for frame time at bar < 1 (%1)\n"), bbt) << endmsg;
return 0;
}
-
+
if (bbt.beats < 1) {
throw std::logic_error ("beats are counted from one");
}
@@ -1246,7 +1246,7 @@ TempoMap::bbt_duration_at (framepos_t pos, const BBT_Time& bbt, int dir)
{
BBT_Time when;
bbt_time (pos, when);
-
+
Glib::Threads::RWLock::ReaderLock lm (lock);
return bbt_duration_at_unlocked (when, bbt, dir);
}
@@ -1376,9 +1376,9 @@ TempoMap::round_to_beat_subdivision (framepos_t fr, int sub_num, RoundMode dir)
double rem;
/* compute the distance to the previous and next subdivision */
-
+
if ((rem = fmod ((double) the_beat.ticks, (double) ticks_one_subdivisions_worth)) > ticks_one_subdivisions_worth/2.0) {
-
+
/* closer to the next subdivision, so shift forward */
the_beat.ticks = lrint (the_beat.ticks + (ticks_one_subdivisions_worth - rem));
@@ -1394,7 +1394,7 @@ TempoMap::round_to_beat_subdivision (framepos_t fr, int sub_num, RoundMode dir)
}
} else if (rem > 0) {
-
+
/* closer to previous subdivision, so shift backward */
if (rem > the_beat.ticks) {
@@ -1437,7 +1437,7 @@ TempoMap::round_to_type (framepos_t frame, RoundMode dir, BBTPointType type)
DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("round from %1 (%3|%4 @ %5) to %6 in direction %2\n", frame, dir, (*fi).bar, (*fi).beat, (*fi).frame,
(type == Bar ? "bar" : "beat")));
-
+
switch (type) {
case Bar:
if (dir < 0) {
@@ -1488,7 +1488,7 @@ TempoMap::round_to_type (framepos_t frame, RoundMode dir, BBTPointType type)
return (*fi).frame;
} else {
-
+
/* true rounding: find nearest bar */
BBTPointList::const_iterator prev = fi;
@@ -1514,7 +1514,7 @@ TempoMap::round_to_type (framepos_t frame, RoundMode dir, BBTPointType type)
} else {
return (*next).frame;
}
-
+
}
break;
@@ -1555,7 +1555,7 @@ TempoMap::round_to_type (framepos_t frame, RoundMode dir, BBTPointType type)
the beat before frame.
*/
++next;
-
+
if ((next == _map.end()) || (frame - (*prev).frame) < ((*next).frame - frame)) {
return (*prev).frame;
} else {
@@ -1684,7 +1684,7 @@ TempoMap::set_state (const XMLNode& node, int /*version*/)
metrics.clear();
nlist = node.children();
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
XMLNode* child = *niter;
@@ -1830,23 +1830,23 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount)
const TempoSection* tempo;
MeterSection *m;
TempoSection *t;
-
+
meter = &first_meter ();
tempo = &first_tempo ();
-
+
BBT_Time start;
BBT_Time end;
-
+
// cerr << "\n###################### TIMESTAMP via AUDIO ##############\n" << endl;
-
+
bool first = true;
MetricSection* prev = 0;
-
+
for (i = metrics.begin(); i != metrics.end(); ++i) {
-
+
BBT_Time bbt;
TempoMetric metric (*meter, *tempo);
-
+
if (prev) {
metric.set_start (prev->start());
metric.set_frame (prev->frame());
@@ -1854,34 +1854,34 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount)
// metric will be at frames=0 bbt=1|1|0 by default
// which is correct for our purpose
}
-
+
BBTPointList::const_iterator bi = bbt_before_or_at ((*i)->frame());
bbt_time ((*i)->frame(), bbt, bi);
-
+
// cerr << "timestamp @ " << (*i)->frame() << " with " << bbt.bars << "|" << bbt.beats << "|" << bbt.ticks << " => ";
-
+
if (first) {
first = false;
} else {
-
+
if (bbt.ticks > BBT_Time::ticks_per_beat/2) {
/* round up to next beat */
bbt.beats += 1;
}
-
+
bbt.ticks = 0;
-
+
if (bbt.beats != 1) {
/* round up to next bar */
bbt.bars += 1;
bbt.beats = 1;
}
}
-
+
// cerr << bbt << endl;
-
+
(*i)->set_start (bbt);
-
+
if ((t = dynamic_cast<TempoSection*>(*i)) != 0) {
tempo = t;
// cerr << "NEW TEMPO, frame = " << (*i)->frame() << " start = " << (*i)->start() <<endl;
@@ -1892,10 +1892,10 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount)
fatal << _("programming error: unhandled MetricSection type") << endmsg;
abort(); /*NOTREACHED*/
}
-
+
prev = (*i);
}
-
+
recompute_map (true);
}
@@ -1908,7 +1908,7 @@ TempoMap::remove_time (framepos_t where, framecnt_t amount)
bool moved = false;
std::list<MetricSection*> metric_kill_list;
-
+
TempoSection* last_tempo = NULL;
MeterSection* last_meter = NULL;
bool tempo_after = false; // is there a tempo marker at the first sample after the removed range?
@@ -1958,7 +1958,7 @@ TempoMap::remove_time (framepos_t where, framecnt_t amount)
if (moved) {
recompute_map (true);
}
- }
+ }
PropertyChanged (PropertyChange ());
return moved;
}
@@ -1991,11 +1991,11 @@ TempoMap::framepos_plus_beats (framepos_t pos, Evoral::Beats beats) const
if (pos < 0 && f == 0) {
f = pos;
}
-
+
if (f > pos) {
break;
}
-
+
tempo = t;
}
}
@@ -2046,7 +2046,7 @@ TempoMap::framepos_plus_beats (framepos_t pos, Evoral::Beats beats) const
while (next_tempo != metrics.end ()) {
++next_tempo;
-
+
if (next_tempo != metrics.end() && dynamic_cast<const TempoSection*>(*next_tempo)) {
break;
}
@@ -2091,7 +2091,7 @@ TempoMap::framepos_minus_beats (framepos_t pos, Evoral::Beats beats) const
keep going to get the previous tempo (or
metrics.rend())
*/
-
+
if (f <= pos) {
if (tempo == 0) {
/* first tempo with position at or
@@ -2121,7 +2121,7 @@ TempoMap::framepos_minus_beats (framepos_t pos, Evoral::Beats beats) const
*/
while (!!beats) {
-
+
/* Distance to the start of this section in frames */
framecnt_t distance_frames = (pos - tempo->frame());
@@ -2236,7 +2236,7 @@ TempoMap::framepos_plus_bbt (framepos_t pos, BBT_Time op) const
* traversed before we change the
* frames_per_beat value.
*/
-
+
pos += llrint (frames_per_beat * (bars * meter->divisions_per_bar()));
bars = 0;
@@ -2343,7 +2343,7 @@ TempoMap::framewalk_to_beats (framepos_t pos, framecnt_t distance) const
DEBUG_TRACE (DEBUG::TempoMath,
string_compose ("frame %1 walk by %2 frames, start with tempo = %3 @ %4\n",
pos, distance, *((const Tempo*)tempo), tempo->frame()));
-
+
Evoral::Beats beats = Evoral::Beats();
while (distance) {
@@ -2391,7 +2391,7 @@ TempoMap::framewalk_to_beats (framepos_t pos, framecnt_t distance) const
while (next_tempo != metrics.end ()) {
++next_tempo;
-
+
if (next_tempo != metrics.end() && dynamic_cast<const TempoSection*>(*next_tempo)) {
break;
}
diff --git a/libs/ardour/test/audio_region_read_test.cc b/libs/ardour/test/audio_region_read_test.cc
index 6a8e3600f1..c7ae50afd5 100644
--- a/libs/ardour/test/audio_region_read_test.cc
+++ b/libs/ardour/test/audio_region_read_test.cc
@@ -31,7 +31,7 @@ void
AudioRegionReadTest::readTest ()
{
int const N = 1024;
-
+
Sample buf[N];
Sample mbuf[N];
float gbuf[N];
@@ -70,7 +70,7 @@ AudioRegionReadTest::readTest ()
for (int i = 64; i < P; ++i) {
CPPUNIT_ASSERT_EQUAL (i, int (buf[i]));
}
-
+
/* Offset read: 256 frames from 128 frames into the region, with fades
(though the fade should not affect it, as it is finished before the read starts)
*/
@@ -78,7 +78,7 @@ AudioRegionReadTest::readTest ()
for (int i = 0; i < N; ++i) {
buf[i] = 0;
}
-
+
_ar[0]->read_at (buf, mbuf, gbuf, P + 128, 256, 0);
check_staircase (buf, 128, 256);
}
diff --git a/libs/ardour/test/audio_region_test.cc b/libs/ardour/test/audio_region_test.cc
index deb0d2e46a..aae25e2f5d 100644
--- a/libs/ardour/test/audio_region_test.cc
+++ b/libs/ardour/test/audio_region_test.cc
@@ -49,14 +49,14 @@ AudioRegionTest::setUp ()
assert (s);
int const signal_length = 4096;
-
+
Sample staircase[signal_length];
for (int i = 0; i < signal_length; ++i) {
staircase[i] = i;
}
s->write (staircase, signal_length);
-
+
PropertyList plist;
plist.add (Properties::start, 0);
plist.add (Properties::length, 100);
@@ -81,4 +81,4 @@ AudioRegionTest::tearDown ()
TestNeedingSession::tearDown ();
}
-
+
diff --git a/libs/ardour/test/automation_list_property_test.cc b/libs/ardour/test/automation_list_property_test.cc
index 7206ee8220..e17ad4f151 100644
--- a/libs/ardour/test/automation_list_property_test.cc
+++ b/libs/ardour/test/automation_list_property_test.cc
@@ -58,7 +58,7 @@ AutomationListPropertyTest::basicTest ()
/* No change since we just cleared them */
CPPUNIT_ASSERT_EQUAL (false, property.changed());
-
+
property->add (1, 2, false, false);
property->add (3, 4, false, false);
diff --git a/libs/ardour/test/bbt_test.cc b/libs/ardour/test/bbt_test.cc
index 86dd389409..416d02ba14 100644
--- a/libs/ardour/test/bbt_test.cc
+++ b/libs/ardour/test/bbt_test.cc
@@ -17,7 +17,7 @@ BBTTest::addTest ()
Meter meter(4.0, 4.0);
map.add_meter (meter, BBT_Time(1, 1, 0));
-
+
/* add some good stuff here */
}
diff --git a/libs/ardour/test/combine_regions_test.cc b/libs/ardour/test/combine_regions_test.cc
index 0202fe8873..5eee1d47d0 100644
--- a/libs/ardour/test/combine_regions_test.cc
+++ b/libs/ardour/test/combine_regions_test.cc
@@ -55,12 +55,12 @@ CombineRegionsTest::check_crossfade1 ()
_ar[1]->fade_in()->curve().get_vector (0, 128, fade_in, 128);
_ar[1]->inverse_fade_in()->curve().get_vector (0, 128, fade_out, 128);
-
+
/* Crossfading _r[0] to _r[1] using _r[1]'s fade in and inverse fade in.
_r[0] also has a standard region fade out to add to the fun.
*/
for (int i = 128; i < 256; ++i) {
-
+
float region_fade_out = 1;
if (i >= 192) {
/* Ardour fades out from 1 to VERY_SMALL_SIGNAL, which is 0.0000001,
@@ -74,7 +74,7 @@ CombineRegionsTest::check_crossfade1 ()
*/
float r0 = i * region_fade_out;
r0 *= fade_out[i - 128];
-
+
float const r1 = (i - 128) * fade_in[i - 128];
CPPUNIT_ASSERT_DOUBLES_EQUAL (r0 + r1, buf[i], 1e-16);
}
@@ -102,7 +102,7 @@ CombineRegionsTest::crossfadeTest1 ()
_ar[0]->set_default_fade_in ();
_ar[0]->set_default_fade_out ();
_ar[1]->set_default_fade_out ();
-
+
_playlist->add_region (_r[0], 0);
_r[0]->set_length (256);
@@ -165,7 +165,7 @@ CombineRegionsTest::check_crossfade2 ()
_ar[0]->inverse_fade_out()->curve().get_vector (0, 128, fade_in, 128);
_ar[0]->fade_out()->curve().get_vector (0, 128, fade_out, 128);
-
+
/* Crossfading _r[0] to _r[1] using _r[0]'s fade out and inverse fade out.
_r[1] also has a standard region fade in to add to the fun.
*/
@@ -179,7 +179,7 @@ CombineRegionsTest::check_crossfade2 ()
float r0 = i * fade_out[i - 128];
float r1 = (i - 128) * region_fade_in;
r1 *= fade_in[i - 128];
-
+
CPPUNIT_ASSERT_DOUBLES_EQUAL (r0 + r1, buf[i], 1e-16);
}
@@ -206,7 +206,7 @@ CombineRegionsTest::crossfadeTest2 ()
_ar[0]->set_default_fade_in ();
_ar[0]->set_default_fade_out ();
_ar[1]->set_default_fade_out ();
-
+
_playlist->add_region (_r[0], 0);
_r[0]->set_length (256);
diff --git a/libs/ardour/test/control_surfaces_test.cc b/libs/ardour/test/control_surfaces_test.cc
index 63c5e33c6f..82b9653455 100644
--- a/libs/ardour/test/control_surfaces_test.cc
+++ b/libs/ardour/test/control_surfaces_test.cc
@@ -32,7 +32,7 @@ void
ControlSurfacesTest::instantiateAndTeardownTest ()
{
_session->new_audio_track (1, 2, Normal, 0, 1, "Test");
-
+
ControlProtocolManager& m = ControlProtocolManager::instance ();
for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
m.activate (**i);
diff --git a/libs/ardour/test/framepos_minus_beats_test.cc b/libs/ardour/test/framepos_minus_beats_test.cc
index a96fec6531..12f020e2d7 100644
--- a/libs/ardour/test/framepos_minus_beats_test.cc
+++ b/libs/ardour/test/framepos_minus_beats_test.cc
@@ -17,7 +17,7 @@ FrameposMinusBeatsTest::singleTempoTest ()
int const bpm = 120;
double const frames_per_beat = (60 / double (bpm)) * double (sampling_rate);
-
+
TempoMap map (sampling_rate);
Tempo tempo (bpm);
Meter meter (4, 4);
@@ -46,14 +46,14 @@ FrameposMinusBeatsTest::doubleTempoTest ()
/*
120bpm at bar 1, 240bpm at bar 4
-
+
120bpm = 24e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm
0 beats 12 beats
0 frames 288e3 frames
@@ -98,14 +98,14 @@ FrameposMinusBeatsTest::doubleTempoWithMeterTest ()
/*
120bpm at bar 1, 240bpm at bar 4
-
+
120bpm = 24e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm
0 beats 12 beats
0 frames 288e3 frames
diff --git a/libs/ardour/test/framepos_plus_beats_test.cc b/libs/ardour/test/framepos_plus_beats_test.cc
index 7069c54115..69fd9a597d 100644
--- a/libs/ardour/test/framepos_plus_beats_test.cc
+++ b/libs/ardour/test/framepos_plus_beats_test.cc
@@ -16,7 +16,7 @@ FrameposPlusBeatsTest::singleTempoTest ()
int const bpm = 120;
double const frames_per_beat = (60 / double (bpm)) * double (sampling_rate);
-
+
TempoMap map (sampling_rate);
Tempo tempo (bpm);
Meter meter (4, 4);
@@ -45,14 +45,14 @@ FrameposPlusBeatsTest::doubleTempoTest ()
/*
120bpm at bar 1, 240bpm at bar 4
-
+
120bpm = 24e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm
0 beats 12 beats
0 frames 288e3 frames
@@ -97,14 +97,14 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest ()
/*
120bpm at bar 1, 240bpm at bar 4
-
+
120bpm = 24e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm
0 beats 12 beats
0 frames 288e3 frames
diff --git a/libs/ardour/test/framewalk_to_beats_test.cc b/libs/ardour/test/framewalk_to_beats_test.cc
index 501eca894e..8b7748cfa4 100644
--- a/libs/ardour/test/framewalk_to_beats_test.cc
+++ b/libs/ardour/test/framewalk_to_beats_test.cc
@@ -15,7 +15,7 @@ FramewalkToBeatsTest::singleTempoTest ()
int const bpm = 120;
double const frames_per_beat = (60 / double (bpm)) * double (sampling_rate);
-
+
TempoMap map (sampling_rate);
Tempo tempo (bpm);
Meter meter (4, 4);
@@ -51,14 +51,14 @@ FramewalkToBeatsTest::doubleTempoTest ()
/*
120bpm at bar 1, 240bpm at bar 4
-
+
120bpm = 24e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm
0 beats 12 beats
0 frames 288e3 frames
@@ -107,15 +107,15 @@ FramewalkToBeatsTest::tripleTempoTest ()
/*
120bpm at bar 1, 240bpm at bar 2, 160bpm at bar 3
-
+
120bpm = 24e3 samples per beat
160bpm = 18e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm 160bpm
0 beats 4 beats 8 beats
0 frames 96e3 frames 144e3 frames
diff --git a/libs/ardour/test/jack_utils_test.cc b/libs/ardour/test/jack_utils_test.cc
index 7645df6ff3..d8a21ceb49 100644
--- a/libs/ardour/test/jack_utils_test.cc
+++ b/libs/ardour/test/jack_utils_test.cc
@@ -273,7 +273,7 @@ JackUtilsTest::test_config ()
std::string command_line;
CPPUNIT_ASSERT (get_default_jack_command_line (command_line));
-
+
CPPUNIT_ASSERT (write_jack_config_file (config_path, command_line));
}
diff --git a/libs/ardour/test/load_session.cc b/libs/ardour/test/load_session.cc
index f2a2a6922e..41dc48ef2f 100644
--- a/libs/ardour/test/load_session.cc
+++ b/libs/ardour/test/load_session.cc
@@ -21,7 +21,7 @@ int main (int argc, char* argv[])
ARDOUR::init (false, true, localedir);
Session* s = 0;
-
+
try {
s = load_session (argv[1], argv[2]);
} catch (failed_constructor& e) {
diff --git a/libs/ardour/test/midi_clock_slave_test.h b/libs/ardour/test/midi_clock_slave_test.h
index dd046fb8a8..0899eed6ce 100644
--- a/libs/ardour/test/midi_clock_slave_test.h
+++ b/libs/ardour/test/midi_clock_slave_test.h
@@ -83,7 +83,7 @@ class MIDIClock_SlaveTest : public CppUnit::TestFixture, ARDOUR::MIDIClock_Slave
public:
MIDIClock_SlaveTest () : MIDIClock_Slave (new TestSlaveSessionProxy) {}
-
+
void setUp() {
}
diff --git a/libs/ardour/test/mtdm_test.cc b/libs/ardour/test/mtdm_test.cc
index 43a6538242..f3265b2ccd 100644
--- a/libs/ardour/test/mtdm_test.cc
+++ b/libs/ardour/test/mtdm_test.cc
@@ -22,7 +22,7 @@ MTDMTest::basicTest ()
mtdm->process (256, in, out);
memcpy (in, out, 256 * sizeof (float));
}
-
+
for (int i = 0; i < 64; ++i) {
mtdm->process (256, in, out);
memcpy (in, out, 256 * sizeof (float));
diff --git a/libs/ardour/test/playlist_equivalent_regions_test.cc b/libs/ardour/test/playlist_equivalent_regions_test.cc
index 12853d39dd..eb34eaf5bc 100644
--- a/libs/ardour/test/playlist_equivalent_regions_test.cc
+++ b/libs/ardour/test/playlist_equivalent_regions_test.cc
@@ -30,7 +30,7 @@ void
PlaylistEquivalentRegionsTest::setUp ()
{
AudioRegionTest::setUp ();
-
+
_playlist_b = PlaylistFactory::create (DataType::AUDIO, *_session, "testB");
}
diff --git a/libs/ardour/test/playlist_read_test.cc b/libs/ardour/test/playlist_read_test.cc
index 78b2e4eadd..e87179fac6 100644
--- a/libs/ardour/test/playlist_read_test.cc
+++ b/libs/ardour/test/playlist_read_test.cc
@@ -67,14 +67,14 @@ PlaylistReadTest::singleReadTest ()
CPPUNIT_ASSERT_EQUAL (double (64), _ar[0]->_fade_out->back()->when);
_ar[0]->set_length (1024);
_audio_playlist->read (_buf, _mbuf, _gbuf, 0, 256, 0);
-
+
for (int i = 0; i < 64; ++i) {
/* Note: this specific float casting is necessary so that the rounding
is done here the same as it is done in AudioPlaylist.
*/
CPPUNIT_ASSERT_DOUBLES_EQUAL (float (i * float (i / 63.0)), _buf[i], 1e-16);
}
-
+
for (int i = 64; i < 256; ++i) {
CPPUNIT_ASSERT_EQUAL (i, int (_buf[i]));
}
@@ -101,7 +101,7 @@ PlaylistReadTest::overlappingReadTest ()
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_in_is_xfade());
CPPUNIT_ASSERT_EQUAL (false, _ar[0]->fade_out_is_xfade());
#endif
-
+
_audio_playlist->add_region (_ar[1], 128);
_ar[1]->set_default_fade_in ();
_ar[1]->set_default_fade_out ();
@@ -111,10 +111,10 @@ PlaylistReadTest::overlappingReadTest ()
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_in_is_xfade());
CPPUNIT_ASSERT_EQUAL (false, _ar[1]->fade_out_is_xfade());
#endif
-
+
CPPUNIT_ASSERT_EQUAL (double (64), _ar[1]->_fade_in->back()->when);
CPPUNIT_ASSERT_EQUAL (double (64), _ar[1]->_fade_out->back()->when);
-
+
_ar[1]->set_length (1024);
_audio_playlist->read (_buf, _mbuf, _gbuf, 0, 256, 0);
@@ -151,7 +151,7 @@ PlaylistReadTest::transparentReadTest ()
CPPUNIT_ASSERT_EQUAL (double (64), _ar[0]->_fade_in->back()->when);
CPPUNIT_ASSERT_EQUAL (double (64), _ar[0]->_fade_out->back()->when);
_ar[0]->set_length (1024);
-
+
_audio_playlist->add_region (_ar[1], 0);
_ar[1]->set_default_fade_in ();
_ar[1]->set_default_fade_out ();
@@ -237,7 +237,7 @@ PlaylistReadTest::enclosedTransparentReadTest ()
_ar[0]->set_fade_in_length (0);
_ar[0]->set_fade_out_length (0);
_ar[0]->set_length (256);
-
+
_audio_playlist->add_region (_ar[1], 0);
/* These calls will result in a 64-sample fade */
_ar[1]->set_fade_in_length (0);
@@ -266,7 +266,7 @@ PlaylistReadTest::enclosedTransparentReadTest ()
for (int i = (256 + 64); i < (256 + 64 + 128); ++i) {
CPPUNIT_ASSERT_DOUBLES_EQUAL (i + i - (256 + 64) + 64, _buf[i], 1e-16);
}
-
+
/* Then _ar[1] + _ar[0] (faded out) for 64 samples */
for (int i = (256 + 64 + 128); i < 512; ++i) {
float const ar0_without_fade = i - 256;
diff --git a/libs/ardour/test/playlist_read_test.h b/libs/ardour/test/playlist_read_test.h
index 97a1eb9eab..5161863409 100644
--- a/libs/ardour/test/playlist_read_test.h
+++ b/libs/ardour/test/playlist_read_test.h
@@ -32,7 +32,7 @@ class PlaylistReadTest : public AudioRegionTest
public:
void setUp ();
void tearDown ();
-
+
void singleReadTest ();
void overlappingReadTest ();
void transparentReadTest ();
@@ -44,6 +44,6 @@ private:
ARDOUR::Sample* _buf;
ARDOUR::Sample* _mbuf;
float* _gbuf;
-
+
void check_staircase (ARDOUR::Sample *, int, int);
};
diff --git a/libs/ardour/test/profiling/load_session.cc b/libs/ardour/test/profiling/load_session.cc
index f2a2a6922e..41dc48ef2f 100644
--- a/libs/ardour/test/profiling/load_session.cc
+++ b/libs/ardour/test/profiling/load_session.cc
@@ -21,7 +21,7 @@ int main (int argc, char* argv[])
ARDOUR::init (false, true, localedir);
Session* s = 0;
-
+
try {
s = load_session (argv[1], argv[2]);
} catch (failed_constructor& e) {
diff --git a/libs/ardour/test/tempo_test.cc b/libs/ardour/test/tempo_test.cc
index 2cac1fa872..4905259351 100644
--- a/libs/ardour/test/tempo_test.cc
+++ b/libs/ardour/test/tempo_test.cc
@@ -18,14 +18,14 @@ TempoTest::recomputeMapTest ()
/*
120bpm at bar 1, 240bpm at bar 4
-
+
120bpm = 24e3 samples per beat
240bpm = 12e3 samples per beat
*/
-
+
/*
-
+
120bpm 240bpm
0 beats 12 beats
0 frames 288e3 frames
diff --git a/libs/ardour/test/test_util.cc b/libs/ardour/test/test_util.cc
index 7be501d100..5220203465 100644
--- a/libs/ardour/test/test_util.cc
+++ b/libs/ardour/test/test_util.cc
@@ -68,7 +68,7 @@ check_nodes (XMLNode const * p, XMLNode const * q, list<string> const & ignore_p
CPPUNIT_ASSERT_EQUAL (qc.size(), pc.size());
XMLNodeList::const_iterator k = pc.begin ();
XMLNodeList::const_iterator l = qc.begin ();
-
+
while (k != pc.end ()) {
check_nodes (*k, *l, ignore_properties);
++k;
diff --git a/libs/ardour/test/testrunner.cc b/libs/ardour/test/testrunner.cc
index 2d9a8fc39e..ddb320e02b 100644
--- a/libs/ardour/test/testrunner.cc
+++ b/libs/ardour/test/testrunner.cc
@@ -54,23 +54,23 @@ main(int argc, char* argv[])
TestUI* test_ui = new TestUI();
CppUnit::TestResult testresult;
-
+
CppUnit::TestResultCollector collectedresults;
testresult.addListener (&collectedresults);
-
+
CppUnit::BriefTestProgressListener progress;
testresult.addListener (&progress);
-
+
CppUnit::TestRunner testrunner;
testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
testrunner.run (testresult);
-
+
CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
compileroutputter.write ();
delete test_ui;
ARDOUR::cleanup ();
-
+
return collectedresults.wasSuccessful () ? 0 : 1;
}
diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc
index 3fe6e66b81..e02143e401 100644
--- a/libs/ardour/ticker.cc
+++ b/libs/ardour/ticker.cc
@@ -49,10 +49,10 @@ public:
bool sync (Session* s) {
bool changed = false;
-
+
double sp = s->transport_speed();
framecnt_t fr = s->transport_frame();
-
+
if (speed != sp) {
speed = sp;
changed = true;
@@ -120,7 +120,7 @@ void
MidiClockTicker::set_session (Session* s)
{
SessionHandlePtr::set_session (s);
-
+
if (_session) {
_session->TransportStateChange.connect_same_thread (_session_connections, boost::bind (&MidiClockTicker::transport_state_changed, this));
_session->TransportLooped.connect_same_thread (_session_connections, boost::bind (&MidiClockTicker::transport_looped, this));
@@ -230,7 +230,7 @@ MidiClockTicker::tick (const framepos_t& /* transport_frame */, pframes_t nframe
send_position_event (llrint (_pos->midi_beats), 0, nframes);
} else if (_pos->speed == 1.0f) {
send_stop_event (0, nframes);
-
+
if (_pos->frame == 0) {
send_start_event (0, nframes);
} else {
@@ -249,21 +249,21 @@ MidiClockTicker::tick (const framepos_t& /* transport_frame */, pframes_t nframe
if (_pos->speed == 1.0f) {
if (_session->get_play_loop()) {
assert(_session->locations()->auto_loop_location());
-
+
if (_pos->frame == _session->locations()->auto_loop_location()->start()) {
send_start_event (0, nframes);
} else {
send_continue_event (0, nframes);
}
-
+
} else if (_pos->frame == 0) {
send_start_event (0, nframes);
} else {
send_continue_event (0, nframes);
}
-
+
// send_midi_clock_event (0);
-
+
} else if (_pos->speed == 0.0f) {
send_stop_event (0, nframes);
send_position_event (llrint (_pos->midi_beats), 0, nframes);
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index 2c9e71ca46..e99d07f047 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -100,9 +100,9 @@ Track::state (bool full)
root.add_property (X_("saved-meter-point"), enum_2_string (_saved_meter_point));
root.add_child_nocopy (_rec_enable_control->get_state());
root.add_child_nocopy (_diskstream->get_state ());
-
+
return root;
-}
+}
int
Track::set_state (const XMLNode& node, int version)
@@ -140,7 +140,7 @@ Track::set_state (const XMLNode& node, int version)
}
}
}
-
+
const XMLProperty* prop;
if ((prop = node.property (X_("monitoring"))) != 0) {
@@ -196,7 +196,7 @@ Track::RecEnableControl::set_value (double val)
if (!t) {
return;
}
-
+
t->set_record_enabled (val >= 0.5 ? true : false, this);
}
@@ -207,7 +207,7 @@ Track::RecEnableControl::get_value () const
if (!t) {
return 0;
}
-
+
return (t->record_enabled() ? 1.0 : 0.0);
}
@@ -235,7 +235,7 @@ Track::prep_record_enabled (bool yn, void *src)
if (yn && record_safe ()) {
return;
}
-
+
if (!_session.writable()) {
return;
}
@@ -255,7 +255,7 @@ Track::prep_record_enabled (bool yn, void *src)
}
bool will_follow;
-
+
if (yn) {
will_follow = _diskstream->prep_record_enable ();
} else {
@@ -279,7 +279,7 @@ Track::set_record_enabled (bool yn, void *src)
if (_diskstream->record_safe ()) {
return;
}
-
+
if (!_session.writable()) {
return;
}
@@ -310,16 +310,16 @@ Track::set_record_safe (bool yn, void *src)
if (!_session.writable()) { /* REQUIRES REVIEW */
return;
}
-
+
if (_freeze_record.state == Frozen) { /* REQUIRES REVIEW */
return;
}
-
+
if (_route_group && src != _route_group && _route_group->is_active() && _route_group->is_recenable()) {
_route_group->apply (&Track::set_record_safe, yn, _route_group);
return;
}
-
+
_diskstream->set_record_safe (yn);
}
@@ -474,12 +474,12 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
be_silent = false;
break;
}
-
+
//if we have an internal generator, let it play regardless of monitoring state
if (_have_internal_generator) {
be_silent = false;
}
-
+
_amp->apply_gain_automation (false);
/* if have_internal_generator, or .. */
@@ -528,7 +528,7 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
} else {
BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
-
+
fill_buffers_with_input (bufs, _input, nframes);
if (_meter_point == MeterInput) {
@@ -942,11 +942,11 @@ MonitorState
Track::monitoring_state () const
{
/* Explicit requests */
-
+
if (_monitoring & MonitorInput) {
return MonitoringInput;
}
-
+
if (_monitoring & MonitorDisk) {
return MonitoringDisk;
}
@@ -954,16 +954,16 @@ Track::monitoring_state () const
/* This is an implementation of the truth table in doc/monitor_modes.pdf;
I don't think it's ever going to be too pretty too look at.
*/
-
+
// GZ: NOT USED IN TRACKS
//bool const auto_input = _session.config.get_auto_input ();
//bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
//bool const tape_machine_mode = Config->get_tape_machine_mode ();
-
+
bool const roll = _session.transport_rolling ();
bool const track_rec = _diskstream->record_enabled ();
bool session_rec = _session.actively_recording ();
-
+
if (track_rec) {
if (!session_rec && roll) {
@@ -993,11 +993,11 @@ MonitorState
Track::monitoring_state () const
{
/* Explicit requests */
-
+
if (_monitoring & MonitorInput) {
return MonitoringInput;
}
-
+
if (_monitoring & MonitorDisk) {
return MonitoringDisk;
}
@@ -1046,7 +1046,7 @@ Track::monitoring_state () const
} else {
return MonitoringDisk;
}
-
+
}
}
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index eb4db99d87..211b9c29f2 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -139,7 +139,7 @@ ARDOUR::legalize_for_path_2X (const string& str)
string::size_type pos;
string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
Glib::ustring legal;
-
+
/* this is the one place in Ardour where we need to iterate across
* potential multibyte characters, and thus we need Glib::ustring
*/
diff --git a/libs/ardour/windows_vst_plugin.cc b/libs/ardour/windows_vst_plugin.cc
index 823b96cffe..abca61155e 100644
--- a/libs/ardour/windows_vst_plugin.cc
+++ b/libs/ardour/windows_vst_plugin.cc
@@ -50,7 +50,7 @@ WindowsVSTPlugin::WindowsVSTPlugin (const WindowsVSTPlugin &other)
throw failed_constructor();
}
Session::vst_current_loading_id = 0;
-
+
_plugin = _state->plugin;
}
diff --git a/libs/audiographer/audiographer/broadcast_info.h b/libs/audiographer/audiographer/broadcast_info.h
index dd776d17af..82641e6c00 100644
--- a/libs/audiographer/audiographer/broadcast_info.h
+++ b/libs/audiographer/audiographer/broadcast_info.h
@@ -33,7 +33,7 @@
namespace AudioGrapher
{
-class SndfileHandle;
+class SndfileHandle;
class LIBAUDIOGRAPHER_API BroadcastInfo
{
diff --git a/libs/audiographer/audiographer/debug_utils.h b/libs/audiographer/audiographer/debug_utils.h
index a8c63e85b6..410567d51b 100644
--- a/libs/audiographer/audiographer/debug_utils.h
+++ b/libs/audiographer/audiographer/debug_utils.h
@@ -34,7 +34,7 @@ struct LIBAUDIOGRAPHER_API DebugUtils
#endif
return typeid(obj).name();
}
-
+
/// Returns name of ProcessContext::Flag
static std::string process_context_flag_name (FlagField::Flag flag);
};
diff --git a/libs/audiographer/audiographer/flag_debuggable.h b/libs/audiographer/audiographer/flag_debuggable.h
index 7ff6a79ed1..f5d4fbf6ed 100644
--- a/libs/audiographer/audiographer/flag_debuggable.h
+++ b/libs/audiographer/audiographer/flag_debuggable.h
@@ -26,14 +26,14 @@ class /*LIBAUDIOGRAPHER_API*/ FlagDebuggable : public Debuggable<L>
{
flags.set (flag);
}
-
+
/// Prints debug output if \a context contains flags that are not supported by this class
template<typename SelfType, typename ContextType>
void check_flags (SelfType & self, ProcessContext<ContextType> context)
{
if (!Debuggable<L>::debug_level (DebugFlags)) { return; }
FlagField unsupported = flags.unsupported_flags_of (context.flags());
-
+
for (FlagField::iterator it = unsupported.begin(); it != unsupported.end(); ++it) {
Debuggable<L>::debug_stream() << boost::str (boost::format
("%1% does not support flag %2%")
diff --git a/libs/audiographer/audiographer/flag_field.h b/libs/audiographer/audiographer/flag_field.h
index 34ab5efdd6..989478f808 100644
--- a/libs/audiographer/audiographer/flag_field.h
+++ b/libs/audiographer/audiographer/flag_field.h
@@ -20,10 +20,10 @@ class LIBAUDIOGRAPHER_API FlagField
, boost::equality_comparable<FlagField>
{
public:
-
+
typedef uint8_t Flag;
typedef uint32_t storage_type;
-
+
/// Bi-directional iterator for flag set. Iterates over flags that are set in this field.
class iterator
: public std::iterator<std::bidirectional_iterator_tag, Flag>
@@ -34,10 +34,10 @@ class LIBAUDIOGRAPHER_API FlagField
public:
iterator (FlagField const & parent, Flag position) : parent (parent), position (position) {}
iterator (iterator const & other) : parent (other.parent), position (other.position) {}
-
+
value_type operator*() const { return position; }
value_type const * operator->() const { return &position; }
-
+
iterator & operator++()
{
do {
@@ -46,7 +46,7 @@ class LIBAUDIOGRAPHER_API FlagField
return *this;
}
iterator operator++(int) { iterator copy (*this); ++(*this); return copy; }
-
+
iterator & operator--()
{
do {
@@ -55,19 +55,19 @@ class LIBAUDIOGRAPHER_API FlagField
return *this;
}
iterator operator--(int) { iterator copy (*this); --(*this); return copy; }
-
+
bool operator< (iterator const & other) const { return position < other.position; }
-
+
private:
FlagField const & parent;
Flag position;
};
-
+
public:
-
+
FlagField() : _flags (0) {}
FlagField(FlagField const & other) : _flags (other._flags) {}
-
+
inline bool has (Flag flag) const { return _flags & (1 << flag); }
inline storage_type flags () const { return _flags; }
inline operator bool() const { return _flags; }
@@ -77,10 +77,10 @@ class LIBAUDIOGRAPHER_API FlagField
/// Returns the flags in \a other that are not set in this field
inline FlagField unsupported_flags_of (FlagField const & other) const { return ~(_flags | ~other._flags); }
-
+
/// Set all flags that are set in \a other
inline FlagField & operator+= (FlagField const & other) { _flags |= other._flags; return *this; }
-
+
/** Checks whether this field has all the flags set that are set in \a other
* NOTE: Can NOT be used for strict weak ordering!
* \return \a true if \a other has flags set that this field does not
@@ -99,7 +99,7 @@ class LIBAUDIOGRAPHER_API FlagField
private:
FlagField(storage_type flags) : _flags (flags) {}
static Flag max() { return CHAR_BIT * sizeof (storage_type) + 1; }
-
+
storage_type _flags;
};
diff --git a/libs/audiographer/audiographer/general/chunker.h b/libs/audiographer/audiographer/general/chunker.h
index d61c68dee4..466a333655 100644
--- a/libs/audiographer/audiographer/general/chunker.h
+++ b/libs/audiographer/audiographer/general/chunker.h
@@ -28,12 +28,12 @@ class /*LIBAUDIOGRAPHER_API*/ Chunker
buffer = new T[chunk_size];
add_supported_flag (ProcessContext<T>::EndOfInput);
}
-
+
~Chunker()
{
delete [] buffer;
}
-
+
/** Outputs data in \a context in chunks with the size specified in the constructor.
* Note that some calls might not produce any output, while others may produce several.
* \n RT safe
@@ -41,15 +41,15 @@ class /*LIBAUDIOGRAPHER_API*/ Chunker
void process (ProcessContext<T> const & context)
{
check_flags (*this, context);
-
+
framecnt_t frames_left = context.frames();
framecnt_t input_position = 0;
-
+
while (position + frames_left >= chunk_size) {
// Copy from context to buffer
framecnt_t const frames_to_copy = chunk_size - position;
TypeUtils<T>::copy (&context.data()[input_position], &buffer[position], frames_to_copy);
-
+
// Update counters
position = 0;
input_position += frames_to_copy;
@@ -60,25 +60,25 @@ class /*LIBAUDIOGRAPHER_API*/ Chunker
if (frames_left) { c_out.remove_flag(ProcessContext<T>::EndOfInput); }
ListedSource<T>::output (c_out);
}
-
+
if (frames_left) {
// Copy the rest of the data
TypeUtils<T>::copy (&context.data()[input_position], &buffer[position], frames_left);
position += frames_left;
}
-
+
if (context.has_flag (ProcessContext<T>::EndOfInput) && position > 0) {
ProcessContext<T> c_out (context, buffer, position);
ListedSource<T>::output (c_out);
}
}
using Sink<T>::process;
-
+
private:
framecnt_t chunk_size;
framecnt_t position;
T * buffer;
-
+
};
} // namespace
diff --git a/libs/audiographer/audiographer/general/deinterleaver.h b/libs/audiographer/audiographer/general/deinterleaver.h
index fac38912d7..63b6c95589 100644
--- a/libs/audiographer/audiographer/general/deinterleaver.h
+++ b/libs/audiographer/audiographer/general/deinterleaver.h
@@ -21,7 +21,7 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
{
private:
typedef boost::shared_ptr<IdentityVertex<T> > OutputPtr;
-
+
public:
/// Constructor. \n RT safe
DeInterleaver()
@@ -29,11 +29,11 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
, max_frames (0)
, buffer (0)
{}
-
+
~DeInterleaver() { reset(); }
-
+
typedef boost::shared_ptr<Source<T> > SourcePtr;
-
+
/// Inits the deinterleaver. Must be called before using. \n Not RT safe
void init (unsigned int num_channels, framecnt_t max_frames_per_channel)
{
@@ -41,53 +41,53 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
channels = num_channels;
max_frames = max_frames_per_channel;
buffer = new T[max_frames];
-
+
for (unsigned int i = 0; i < channels; ++i) {
outputs.push_back (OutputPtr (new IdentityVertex<T>));
}
}
-
+
/// Returns an output indexed by \a channel \n RT safe
SourcePtr output (unsigned int channel)
{
if (throw_level (ThrowObject) && channel >= channels) {
throw Exception (*this, "channel out of range");
}
-
+
return outputs[channel];
}
-
+
/// Deinterleaves data and outputs it to the outputs. \n RT safe
void process (ProcessContext<T> const & c)
{
framecnt_t frames = c.frames();
T const * data = c.data();
-
+
framecnt_t const frames_per_channel = frames / channels;
-
+
if (throw_level (ThrowProcess) && c.channels() != channels) {
throw Exception (*this, "wrong amount of channels given to process()");
}
-
+
if (throw_level (ThrowProcess) && frames_per_channel > max_frames) {
throw Exception (*this, "too many frames given to process()");
}
-
+
unsigned int channel = 0;
for (typename std::vector<OutputPtr>::iterator it = outputs.begin(); it != outputs.end(); ++it, ++channel) {
if (!*it) { continue; }
-
+
for (unsigned int i = 0; i < frames_per_channel; ++i) {
buffer[i] = data[channel + (channels * i)];
}
-
+
ProcessContext<T> c_out (c, buffer, frames_per_channel, 1);
(*it)->process (c_out);
}
}
-
+
using Sink<T>::process;
-
+
private:
void reset ()
@@ -98,7 +98,7 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver
channels = 0;
max_frames = 0;
}
-
+
std::vector<OutputPtr> outputs;
unsigned int channels;
framecnt_t max_frames;
diff --git a/libs/audiographer/audiographer/general/interleaver.h b/libs/audiographer/audiographer/general/interleaver.h
index 2bc62e5443..c1b5e92cfe 100644
--- a/libs/audiographer/audiographer/general/interleaver.h
+++ b/libs/audiographer/audiographer/general/interleaver.h
@@ -21,30 +21,30 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
, public Throwing<>
{
public:
-
+
/// Constructs an interleaver \n RT safe
Interleaver()
: channels (0)
, max_frames (0)
, buffer (0)
{}
-
+
~Interleaver() { reset(); }
-
+
/// Inits the interleaver. Must be called before using. \n Not RT safe
void init (unsigned int num_channels, framecnt_t max_frames_per_channel)
{
reset();
channels = num_channels;
max_frames = max_frames_per_channel;
-
+
buffer = new T[channels * max_frames];
-
+
for (unsigned int i = 0; i < channels; ++i) {
inputs.push_back (InputPtr (new Input (*this, i)));
}
}
-
+
/** Returns the input indexed by \a channel \n RT safe
* \n The \a process function of returned Sinks are also RT Safe
*/
@@ -53,10 +53,10 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
if (throw_level (ThrowObject) && channel >= channels) {
throw Exception (*this, "Channel out of range");
}
-
+
return boost::static_pointer_cast<Sink<T> > (inputs[channel]);
}
-
+
private:
class Input : public Sink<T>
@@ -64,7 +64,7 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
public:
Input (Interleaver & parent, unsigned int channel)
: frames_written (0), parent (parent), channel (channel) {}
-
+
void process (ProcessContext<T> const & c)
{
if (parent.throw_level (ThrowProcess) && c.channels() > 1) {
@@ -76,18 +76,18 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
frames_written = c.frames();
parent.write_channel (c, channel);
}
-
+
using Sink<T>::process;
-
+
framecnt_t frames() { return frames_written; }
void reset() { frames_written = 0; }
-
+
private:
framecnt_t frames_written;
Interleaver & parent;
unsigned int channel;
};
-
+
void reset ()
{
inputs.clear();
@@ -96,7 +96,7 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
channels = 0;
max_frames = 0;
}
-
+
void reset_channels ()
{
for (unsigned int i = 0; i < channels; ++i) {
@@ -104,18 +104,18 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
}
}
-
+
void write_channel (ProcessContext<T> const & c, unsigned int channel)
{
if (throw_level (ThrowProcess) && c.frames() > max_frames) {
reset_channels();
throw Exception (*this, "Too many frames given to an input");
}
-
+
for (unsigned int i = 0; i < c.frames(); ++i) {
buffer[channel + (channels * i)] = c.data()[i];
}
-
+
framecnt_t const ready_frames = ready_to_output();
if (ready_frames) {
ProcessContext<T> c_out (c, buffer, ready_frames, channels);
@@ -142,7 +142,7 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver
typedef boost::shared_ptr<Input> InputPtr;
std::vector<InputPtr> inputs;
-
+
unsigned int channels;
framecnt_t max_frames;
T * buffer;
diff --git a/libs/audiographer/audiographer/general/normalizer.h b/libs/audiographer/audiographer/general/normalizer.h
index e95f0e3852..025131022e 100644
--- a/libs/audiographer/audiographer/general/normalizer.h
+++ b/libs/audiographer/audiographer/general/normalizer.h
@@ -32,7 +32,7 @@ public:
/// Process a const ProcessContext \see alloc_buffer() \n RT safe
void process (ProcessContext<float> const & c);
-
+
/// Process a non-const ProcsesContext in-place \n RT safe
void process (ProcessContext<float> & c);
@@ -40,7 +40,7 @@ private:
bool enabled;
float target;
float gain;
-
+
float * buffer;
framecnt_t buffer_size;
};
diff --git a/libs/audiographer/audiographer/general/peak_reader.h b/libs/audiographer/audiographer/general/peak_reader.h
index dd5d65491c..8bf0faa792 100644
--- a/libs/audiographer/audiographer/general/peak_reader.h
+++ b/libs/audiographer/audiographer/general/peak_reader.h
@@ -15,10 +15,10 @@ class /*LIBAUDIOGRAPHER_API*/ PeakReader : public ListedSource<float>, public Si
public:
/// Constructor \n RT safe
PeakReader() : peak (0.0) {}
-
+
/// Returns the highest absolute of the values found so far. \n RT safe
float get_peak() { return peak; }
-
+
/// Resets the peak to 0 \n RT safe
void reset() { peak = 0.0; }
@@ -28,9 +28,9 @@ class /*LIBAUDIOGRAPHER_API*/ PeakReader : public ListedSource<float>, public Si
peak = Routines::compute_peak (c.data(), c.frames(), peak);
ListedSource<float>::output(c);
}
-
+
using Sink<float>::process;
-
+
private:
float peak;
};
diff --git a/libs/audiographer/audiographer/general/sample_format_converter.h b/libs/audiographer/audiographer/general/sample_format_converter.h
index af30ac1605..96dd6aa72a 100644
--- a/libs/audiographer/audiographer/general/sample_format_converter.h
+++ b/libs/audiographer/audiographer/general/sample_format_converter.h
@@ -17,7 +17,7 @@ enum /*LIBAUDIOGRAPHER_API*/ DitherType
D_Tri = GDitherTri, ///< Triangular dithering
D_Shaped = GDitherShaped ///< Actually noise shaping, only works for 46kHzish signals
};
-
+
/** Sample format converter that does dithering.
* This class can only convert floats to either \a float, \a int32_t, \a int16_t, or \a uint8_t
*/
@@ -33,7 +33,7 @@ class LIBAUDIOGRAPHER_API SampleFormatConverter
*/
SampleFormatConverter (ChannelCount channels);
~SampleFormatConverter ();
-
+
/** Initialize and allocate buffers for processing.
* \param max_frames maximum number of frames that is allowed to be used in calls to \a process()
* \param type dither type from \a DitherType
@@ -45,10 +45,10 @@ class LIBAUDIOGRAPHER_API SampleFormatConverter
/// Set whether or not clipping to [-1.0, 1.0] should occur when TOut = float. Clipping is off by default
void set_clip_floats (bool yn) { clip_floats = yn; }
-
+
/// Processes data without modifying it
void process (ProcessContext<float> const & c_in);
-
+
/// This version is only different in the case when \a TOut = float, and float clipping is on.
void process (ProcessContext<float> & c_in);
diff --git a/libs/audiographer/audiographer/general/silence_trimmer.h b/libs/audiographer/audiographer/general/silence_trimmer.h
index a715feb0c8..7e8d3c485c 100644
--- a/libs/audiographer/audiographer/general/silence_trimmer.h
+++ b/libs/audiographer/audiographer/general/silence_trimmer.h
@@ -47,14 +47,14 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
throw Exception (*this,
"Silence trimmer constructor and reset() must be called with a non-zero parameter!");
}
-
+
if (silence_buffer_size != silence_buffer_size_) {
silence_buffer_size = silence_buffer_size_;
delete [] silence_buffer;
silence_buffer = new T[silence_buffer_size];
TypeUtils<T>::zero_fill (silence_buffer, silence_buffer_size);
}
-
+
in_beginning = true;
in_end = false;
trim_beginning = false;
@@ -64,7 +64,7 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
add_to_beginning = 0;
add_to_end = 0;
}
-
+
/** Tells that \a frames_per_channel frames of silence per channel should be added to beginning
* Needs to be called before starting processing.
* \n RT safe
@@ -76,7 +76,7 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
}
add_to_beginning = frames_per_channel;
}
-
+
/** Tells that \a frames_per_channel frames of silence per channel should be added to end
* Needs to be called before end is reached.
* \n RT safe
@@ -88,7 +88,7 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
}
add_to_end = frames_per_channel;
}
-
+
/** Tells whether ot nor silence should be trimmed from the beginning
* Has to be called before starting processing.
* \n RT safe
@@ -100,7 +100,7 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
}
trim_beginning = yn;
}
-
+
/** Tells whether ot nor silence should be trimmed from the end
* Has to be called before the is reached.
* \n RT safe
@@ -124,9 +124,9 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
debug_stream () << DebugUtils::demangled_name (*this) <<
"::process()" << std::endl;
}
-
+
check_flags (*this, c);
-
+
if (throw_level (ThrowStrict) && in_end) {
throw Exception(*this, "process() after reaching end of input");
}
@@ -134,27 +134,27 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
// If adding to end, delay end of input propagation
if (add_to_end) { c.remove_flag(ProcessContext<T>::EndOfInput); }
-
+
framecnt_t frame_index = 0;
-
+
if (in_beginning) {
-
+
bool has_data = true;
-
+
// only check silence if doing either of these
// This will set both has_data and frame_index
if (add_to_beginning || trim_beginning) {
has_data = find_first_non_zero_sample (c, frame_index);
}
-
+
// Added silence if there is silence to add
if (add_to_beginning) {
-
+
if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) <<
" adding to beginning" << std::endl;
}
-
+
ConstProcessContext<T> c_copy (c);
if (has_data) { // There will be more output, so remove flag
c_copy().remove_flag (ProcessContext<T>::EndOfInput);
@@ -162,54 +162,54 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
add_to_beginning *= c.channels();
output_silence_frames (c_copy, add_to_beginning);
}
-
+
// If we are not trimming the beginning, output everything
// Then has_data = true and frame_index = 0
// Otherwise these reflect the silence state
if (has_data) {
-
+
if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) <<
" outputting whole frame to beginning" << std::endl;
}
-
+
in_beginning = false;
ConstProcessContext<T> c_out (c, &c.data()[frame_index], c.frames() - frame_index);
ListedSource<T>::output (c_out);
}
-
+
} else if (trim_end) { // Only check zero samples if trimming end
-
+
if (find_first_non_zero_sample (c, frame_index)) {
-
+
if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) <<
" flushing intermediate silence and outputting frame" << std::endl;
}
-
+
// context contains non-zero data
output_silence_frames (c, silence_frames); // flush intermediate silence
ListedSource<T>::output (c); // output rest of data
} else { // whole context is zero
-
+
if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) <<
" no, output, adding frames to silence count" << std::endl;
}
-
+
silence_frames += c.frames();
}
-
+
} else { // no need to do anything special
-
+
if (debug_level (DebugVerbose)) {
debug_stream () << DebugUtils::demangled_name (*this) <<
" outputting whole frame in middle" << std::endl;
}
-
+
ListedSource<T>::output (c);
}
-
+
// Finally, if in end, add silence to end
if (in_end && add_to_end) {
c.set_flag (ProcessContext<T>::EndOfInput);
@@ -218,7 +218,7 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
debug_stream () << DebugUtils::demangled_name (*this) <<
" adding to end" << std::endl;
}
-
+
add_to_end *= c.channels();
output_silence_frames (c, add_to_end, true);
}
@@ -240,22 +240,22 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
}
return false;
}
-
+
void output_silence_frames (ProcessContext<T> const & c, framecnt_t & total_frames, bool adding_to_end = false)
{
bool end_of_input = c.has_flag (ProcessContext<T>::EndOfInput);
c.remove_flag (ProcessContext<T>::EndOfInput);
-
+
while (total_frames > 0) {
framecnt_t frames = std::min (silence_buffer_size, total_frames);
if (max_output_frames) {
frames = std::min (frames, max_output_frames);
}
frames -= frames % c.channels();
-
+
total_frames -= frames;
ConstProcessContext<T> c_out (c, silence_buffer, frames);
-
+
// boolean commentation :)
bool const no_more_silence_will_be_added = adding_to_end || (add_to_end == 0);
bool const is_last_frame_output_in_this_function = (total_frames == 0);
@@ -272,16 +272,16 @@ class /*LIBAUDIOGRAPHER_API*/ SilenceTrimmer
bool in_beginning;
bool in_end;
-
+
bool trim_beginning;
bool trim_end;
-
+
framecnt_t silence_frames;
framecnt_t max_output_frames;
-
+
framecnt_t add_to_beginning;
framecnt_t add_to_end;
-
+
framecnt_t silence_buffer_size;
T * silence_buffer;
};
diff --git a/libs/audiographer/audiographer/general/sr_converter.h b/libs/audiographer/audiographer/general/sr_converter.h
index 0cbe3bd294..a2e94d9bc0 100644
--- a/libs/audiographer/audiographer/general/sr_converter.h
+++ b/libs/audiographer/audiographer/general/sr_converter.h
@@ -27,10 +27,10 @@ class LIBAUDIOGRAPHER_API SampleRateConverter
/// Init converter \n Not RT safe
void init (framecnt_t in_rate, framecnt_t out_rate, int quality = 0);
-
+
/// Returns max amount of frames that will be output \n RT safe
framecnt_t allocate_buffers (framecnt_t max_frames);
-
+
/** Does sample rate conversion.
* Note that outpt size may vary a lot.
* May or may not output several contexts of data.
@@ -48,7 +48,7 @@ class LIBAUDIOGRAPHER_API SampleRateConverter
bool active;
uint32_t channels;
framecnt_t max_frames_in;
-
+
float * leftover_data;
framecnt_t leftover_frames;
framecnt_t max_leftover_frames;
diff --git a/libs/audiographer/audiographer/general/threader.h b/libs/audiographer/audiographer/general/threader.h
index e9a953ce44..2ef4099efe 100644
--- a/libs/audiographer/audiographer/general/threader.h
+++ b/libs/audiographer/audiographer/general/threader.h
@@ -39,7 +39,7 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source<T>, public Sink<T>
typedef std::vector<typename Source<T>::SinkPtr> OutputVec;
public:
-
+
/** Constructor
* \n RT safe
* \param thread_pool a thread pool from which all tasks are scheduled
@@ -50,39 +50,39 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source<T>, public Sink<T>
, readers (0)
, wait_timeout (wait_timeout_milliseconds)
{ }
-
+
virtual ~Threader () {}
-
+
/// Adds output \n RT safe
void add_output (typename Source<T>::SinkPtr output) { outputs.push_back (output); }
-
+
/// Clears outputs \n RT safe
void clear_outputs () { outputs.clear (); }
-
+
/// Removes a specific output \n RT safe
void remove_output (typename Source<T>::SinkPtr output) {
typename OutputVec::iterator new_end = std::remove(outputs.begin(), outputs.end(), output);
outputs.erase (new_end, outputs.end());
}
-
+
/// Processes context concurrently by scheduling each output separately to the given thread pool
void process (ProcessContext<T> const & c)
{
wait_mutex.lock();
-
+
exception.reset();
-
+
unsigned int outs = outputs.size();
g_atomic_int_add (&readers, outs);
for (unsigned int i = 0; i < outs; ++i) {
thread_pool.push (sigc::bind (sigc::mem_fun (this, &Threader::process_output), c, i));
}
-
+
wait();
}
-
+
using Sink<T>::process;
-
+
private:
void wait()
@@ -93,12 +93,12 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source<T>, public Sink<T>
}
wait_mutex.unlock();
-
+
if (exception) {
throw *exception;
}
}
-
+
void process_output(ProcessContext<T> const & c, unsigned int output)
{
try {
@@ -109,7 +109,7 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source<T>, public Sink<T>
if(!exception) { exception.reset (new ThreaderException (*this, e)); }
exception_mutex.unlock();
}
-
+
if (g_atomic_int_dec_and_test (&readers)) {
wait_cond.signal();
}
@@ -122,7 +122,7 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source<T>, public Sink<T>
Glib::Threads::Cond wait_cond;
gint readers;
long wait_timeout;
-
+
Glib::Threads::Mutex exception_mutex;
boost::shared_ptr<ThreaderException> exception;
diff --git a/libs/audiographer/audiographer/process_context.h b/libs/audiographer/audiographer/process_context.h
index 36abd4fba0..16e637b85c 100644
--- a/libs/audiographer/audiographer/process_context.h
+++ b/libs/audiographer/audiographer/process_context.h
@@ -45,30 +45,30 @@ public:
ProcessContext (T * data, framecnt_t frames, ChannelCount channels)
: _data (data), _frames (frames), _channels (channels)
{ validate_data(); }
-
+
/// Normal copy constructor
ProcessContext (ProcessContext<T> const & other)
: Throwing<throwLevel>(), _data (other._data), _frames (other._frames), _channels (other._channels), _flags (other._flags)
{ /* No need to validate data */ }
-
+
/// "Copy constructor" with unique data, frame and channel count, but copies flags
template<typename Y>
ProcessContext (ProcessContext<Y> const & other, T * data, framecnt_t frames, ChannelCount channels)
: Throwing<throwLevel>(), _data (data), _frames (frames), _channels (channels), _flags (other.flags())
{ validate_data(); }
-
+
/// "Copy constructor" with unique data and frame count, but copies channel count and flags
template<typename Y>
ProcessContext (ProcessContext<Y> const & other, T * data, framecnt_t frames)
: Throwing<throwLevel>(), _data (data), _frames (frames), _channels (other.channels()), _flags (other.flags())
{ validate_data(); }
-
+
/// "Copy constructor" with unique data, but copies frame and channel count + flags
template<typename Y>
ProcessContext (ProcessContext<Y> const & other, T * data)
: Throwing<throwLevel>(), _data (data), _frames (other.frames()), _channels (other.channels()), _flags (other.flags())
{ /* No need to validate data */ }
-
+
/// Make new Context out of the beginning of this context
ProcessContext beginning (framecnt_t frames)
{
@@ -78,39 +78,39 @@ public:
% DebugUtils::demangled_name (*this) % frames % _frames));
}
validate_data ();
-
+
return ProcessContext (*this, _data, frames);
}
-
+
virtual ~ProcessContext () {}
-
+
/// \a data points to the array of data to process
inline T const * data() const { return _data; }
inline T * data() { return _data; }
-
+
/// \a frames tells how many frames the array pointed by data contains
inline framecnt_t const & frames() const { return _frames; }
-
+
/** \a channels tells how many interleaved channels \a data contains
* If \a channels is greater than 1, each channel contains \a frames / \a channels frames of data
*/
inline ChannelCount const & channels() const { return _channels; }
-
+
/// Returns the amount of frames per channel
inline framecnt_t frames_per_channel() const { return _frames / _channels; }
/* Flags */
-
+
inline bool has_flag (Flag flag) const { return _flags.has (flag); }
inline void set_flag (Flag flag) const { _flags.set (flag); }
inline void remove_flag (Flag flag) const { _flags.remove (flag); }
inline FlagField const & flags () const { return _flags; }
-
+
protected:
T * const _data;
framecnt_t _frames;
ChannelCount _channels;
-
+
mutable FlagField _flags;
private:
@@ -132,32 +132,32 @@ public:
/// Allocates uninitialized memory
AllocatingProcessContext (framecnt_t frames, ChannelCount channels)
: ProcessContext<T> (new T[frames], frames, channels) {}
-
+
/// Allocates and copies data from raw buffer
AllocatingProcessContext (T const * data, framecnt_t frames, ChannelCount channels)
: ProcessContext<T> (new T[frames], frames, channels)
{ TypeUtils<float>::copy (data, ProcessContext<T>::_data, frames); }
-
+
/// Copy constructor, copies data from other ProcessContext
AllocatingProcessContext (ProcessContext<T> const & other)
: ProcessContext<T> (other, new T[other._frames])
{ TypeUtils<float>::copy (ProcessContext<T>::_data, other._data, other._frames); }
-
+
/// "Copy constructor" with uninitialized data, unique frame and channel count, but copies flags
template<typename Y>
AllocatingProcessContext (ProcessContext<Y> const & other, framecnt_t frames, ChannelCount channels)
: ProcessContext<T> (other, new T[frames], frames, channels) {}
-
+
/// "Copy constructor" with uninitialized data, unique frame count, but copies channel count and flags
template<typename Y>
AllocatingProcessContext (ProcessContext<Y> const & other, framecnt_t frames)
: ProcessContext<T> (other, new T[frames], frames, other.channels()) {}
-
+
/// "Copy constructor" uninitialized data, that copies frame and channel count + flags
template<typename Y>
AllocatingProcessContext (ProcessContext<Y> const & other)
: ProcessContext<T> (other, new T[other._frames]) {}
-
+
~AllocatingProcessContext () { delete [] ProcessContext<T>::_data; }
};
@@ -169,21 +169,21 @@ class /*LIBAUDIOGRAPHER_API*/ ConstProcessContext
/// Basic constructor with data, frame and channel count
ConstProcessContext (T const * data, framecnt_t frames, ChannelCount channels)
: context (const_cast<T *>(data), frames, channels) {}
-
+
/// Copy constructor from const ProcessContext
ConstProcessContext (ProcessContext<T> const & other)
: context (const_cast<ProcessContext<T> &> (other)) {}
-
+
/// "Copy constructor", with unique data, frame and channel count, but copies flags
template<typename ProcessContext>
ConstProcessContext (ProcessContext const & other, T const * data, framecnt_t frames, ChannelCount channels)
: context (other, const_cast<T *>(data), frames, channels) {}
-
+
/// "Copy constructor", with unique data and frame count, but copies channel count and flags
template<typename ProcessContext>
ConstProcessContext (ProcessContext const & other, T const * data, framecnt_t frames)
: context (other, const_cast<T *>(data), frames) {}
-
+
/// "Copy constructor", with unique data, but copies frame and channel count + flags
template<typename ProcessContext>
ConstProcessContext (ProcessContext const & other, T const * data)
diff --git a/libs/audiographer/audiographer/routines.h b/libs/audiographer/audiographer/routines.h
index 4ab3bc5fb5..d78fa602b6 100644
--- a/libs/audiographer/audiographer/routines.h
+++ b/libs/audiographer/audiographer/routines.h
@@ -15,13 +15,13 @@ class LIBAUDIOGRAPHER_API Routines
{
public:
typedef uint32_t uint_type;
-
+
typedef float (*compute_peak_t) (float const *, uint_type, float);
typedef void (*apply_gain_to_buffer_t) (float *, uint_type, float);
-
+
static void override_compute_peak (compute_peak_t func) { _compute_peak = func; }
static void override_apply_gain_to_buffer (apply_gain_to_buffer_t func) { _apply_gain_to_buffer = func; }
-
+
/** Computes peak in float buffer
* \n RT safe
* \param data buffer from which the peak is computed
@@ -61,7 +61,7 @@ class LIBAUDIOGRAPHER_API Routines
data[i] *= gain;
}
}
-
+
static compute_peak_t _compute_peak;
static apply_gain_to_buffer_t _apply_gain_to_buffer;
};
diff --git a/libs/audiographer/audiographer/sink.h b/libs/audiographer/audiographer/sink.h
index b1e5605206..da9e7350ee 100644
--- a/libs/audiographer/audiographer/sink.h
+++ b/libs/audiographer/audiographer/sink.h
@@ -17,13 +17,13 @@ template <typename T>
class /*LIBAUDIOGRAPHER_API*/ Sink {
public:
virtual ~Sink () {}
-
+
/** Process given data.
* The data can not be modified, so in-place processing is not allowed.
* At least this function must be implemented by deriving classes
*/
virtual void process (ProcessContext<T> const & context) = 0;
-
+
/** Process given data
* Data may be modified, so in place processing is allowed.
* The default implementation calls the non-modifying version,
diff --git a/libs/audiographer/audiographer/sndfile/sndfile.h b/libs/audiographer/audiographer/sndfile/sndfile.h
index 939e5f8a2c..c48a0331ab 100644
--- a/libs/audiographer/audiographer/sndfile/sndfile.h
+++ b/libs/audiographer/audiographer/sndfile/sndfile.h
@@ -14,15 +14,15 @@ template<typename T = DefaultSampleType>
class Sndfile : public SndfileWriter<T>, public SndfileReader<T>
{
public:
-
+
Sndfile (std::string const & filename, SndfileBase::Mode mode = SndfileBase::ReadWrite, int format = 0,
ChannelCount channels = 0, framecnt_t samplerate = 0)
: SndfileHandle (filename, mode, format, channels, samplerate)
{}
-
+
Sndfile (Sndfile const & other) : SndfileHandle (other) {}
using SndfileHandle::operator=;
-
+
};
} // namespace
diff --git a/libs/audiographer/audiographer/sndfile/sndfile_base.h b/libs/audiographer/audiographer/sndfile/sndfile_base.h
index 02d5a7f6ea..67a34d484e 100644
--- a/libs/audiographer/audiographer/sndfile/sndfile_base.h
+++ b/libs/audiographer/audiographer/sndfile/sndfile_base.h
@@ -18,7 +18,7 @@ class SndfileBase : public virtual AudioGrapher::SndfileHandle
Write = SFM_WRITE,
ReadWrite = SFM_RDWR
};
-
+
protected:
SndfileBase () {}
};
diff --git a/libs/audiographer/audiographer/sndfile/sndfile_reader.h b/libs/audiographer/audiographer/sndfile/sndfile_reader.h
index aa3c0cc899..ea27470d77 100644
--- a/libs/audiographer/audiographer/sndfile/sndfile_reader.h
+++ b/libs/audiographer/audiographer/sndfile/sndfile_reader.h
@@ -18,13 +18,13 @@ class SndfileReader
, public Throwing<>
{
public:
-
+
SndfileReader (std::string const & path) : SndfileHandle (path) {}
virtual ~SndfileReader () {}
SndfileReader (SndfileReader const & other) : SndfileHandle (other) {}
using SndfileHandle::operator=;
-
+
/** Read data into buffer in \a context, only the data is modified (not frame count)
* Note that the data read is output to the outputs, as well as read into the context
* \return number of frames read
@@ -36,17 +36,17 @@ class SndfileReader
("Wrong number of channels given to process(), %1% instead of %2%")
% context.channels() % channels()));
}
-
+
framecnt_t const frames_read = SndfileHandle::read (context.data(), context.frames());
ProcessContext<T> c_out = context.beginning (frames_read);
-
+
if (frames_read < context.frames()) {
c_out.set_flag (ProcessContext<T>::EndOfInput);
}
this->output (c_out);
return frames_read;
}
-
+
protected:
/// SndfileHandle has to be constructed directly by deriving classes
SndfileReader () {}
diff --git a/libs/audiographer/audiographer/sndfile/sndfile_writer.h b/libs/audiographer/audiographer/sndfile/sndfile_writer.h
index 984ec01d41..57ad968dc5 100644
--- a/libs/audiographer/audiographer/sndfile/sndfile_writer.h
+++ b/libs/audiographer/audiographer/sndfile/sndfile_writer.h
@@ -37,9 +37,9 @@ class SndfileWriter
broadcast_info->write_to_file (this);
}
}
-
+
virtual ~SndfileWriter () {}
-
+
SndfileWriter (SndfileWriter const & other)
: SndfileHandle (other)
{
@@ -50,18 +50,18 @@ class SndfileWriter
framecnt_t get_frames_written() const { return frames_written; }
void reset_frames_written_count() { frames_written = 0; }
-
+
/// Writes data to file
void process (ProcessContext<T> const & c)
{
check_flags (*this, c);
-
+
if (throw_level (ThrowStrict) && c.channels() != channels()) {
throw Exception (*this, boost::str (boost::format
("Wrong number of channels given to process(), %1% instead of %2%")
% c.channels() % channels()));
}
-
+
framecnt_t const written = write (c.data(), c.frames());
frames_written += written;
@@ -76,9 +76,9 @@ class SndfileWriter
FileWritten (path);
}
}
-
+
using Sink<T>::process;
-
+
PBD::Signal1<void, std::string> FileWritten;
protected:
diff --git a/libs/audiographer/audiographer/source.h b/libs/audiographer/audiographer/source.h
index 945cb13298..2d80345b9b 100644
--- a/libs/audiographer/audiographer/source.h
+++ b/libs/audiographer/audiographer/source.h
@@ -19,15 +19,15 @@ class /*LIBAUDIOGRAPHER_API*/ Source
{
public:
virtual ~Source () { }
-
+
typedef boost::shared_ptr<Sink<T> > SinkPtr;
-
+
/// Adds an output to this source. All data generated is forwarded to \a output
virtual void add_output (SinkPtr output) = 0;
-
+
/// Removes all outputs added
virtual void clear_outputs () = 0;
-
+
/// Removes a specific output from this source
virtual void remove_output (SinkPtr output) = 0;
};
diff --git a/libs/audiographer/audiographer/type_utils.h b/libs/audiographer/audiographer/type_utils.h
index e86fbcc282..4e12937165 100644
--- a/libs/audiographer/audiographer/type_utils.h
+++ b/libs/audiographer/audiographer/type_utils.h
@@ -17,7 +17,7 @@ namespace AudioGrapher
class LIBAUDIOGRAPHER_API TypeUtilsBase
{
protected:
-
+
template<typename T, bool b>
static void do_zero_fill(T * buffer, framecnt_t frames, const boost::integral_constant<bool, b>&)
{ std::uninitialized_fill_n (buffer, frames, T()); }
@@ -32,7 +32,7 @@ template<typename T = DefaultSampleType>
class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase
{
BOOST_STATIC_ASSERT (boost::has_trivial_destructor<T>::value);
-
+
typedef boost::integral_constant<bool,
boost::is_floating_point<T>::value ||
boost::is_signed<T>::value> zero_fillable;
@@ -44,14 +44,14 @@ class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase
*/
inline static void zero_fill (T * buffer, framecnt_t frames)
{ do_zero_fill(buffer, frames, zero_fillable()); }
-
+
/** Copies \a frames frames of data from \a source to \a destination
* The source and destination may NOT overlap.
* \n RT safe
*/
inline static void copy (T const * source, T * destination, framecnt_t frames)
{ std::uninitialized_copy (source, &source[frames], destination); }
-
+
/** Moves \a frames frames of data from \a source to \a destination
* The source and destination may overlap in any way.
* \n RT safe
diff --git a/libs/audiographer/audiographer/types.h b/libs/audiographer/audiographer/types.h
index 4288dce0c6..1ecf6360a0 100644
--- a/libs/audiographer/audiographer/types.h
+++ b/libs/audiographer/audiographer/types.h
@@ -7,9 +7,9 @@
namespace AudioGrapher {
-/* XXX: copied from libardour */
+/* XXX: copied from libardour */
typedef int64_t framecnt_t;
-
+
typedef uint8_t ChannelCount;
typedef float DefaultSampleType;
diff --git a/libs/audiographer/audiographer/utils/listed_source.h b/libs/audiographer/audiographer/utils/listed_source.h
index b9bfbc65f8..7069f13c72 100644
--- a/libs/audiographer/audiographer/utils/listed_source.h
+++ b/libs/audiographer/audiographer/utils/listed_source.h
@@ -19,11 +19,11 @@ class /*LIBAUDIOGRAPHER_API*/ ListedSource : public Source<T>
void add_output (typename Source<T>::SinkPtr output) { outputs.push_back(output); }
void clear_outputs () { outputs.clear(); }
void remove_output (typename Source<T>::SinkPtr output) { outputs.remove(output); }
-
+
protected:
-
+
typedef std::list<typename Source<T>::SinkPtr> SinkList;
-
+
/// Helper for derived classes
void output (ProcessContext<T> const & c)
{
diff --git a/libs/audiographer/src/debug_utils.cc b/libs/audiographer/src/debug_utils.cc
index c243164f58..4113ad7841 100644
--- a/libs/audiographer/src/debug_utils.cc
+++ b/libs/audiographer/src/debug_utils.cc
@@ -30,7 +30,7 @@ std::string
DebugUtils::process_context_flag_name (FlagField::Flag flag)
{
std::ostringstream ret;
-
+
switch (flag) {
case ProcessContext<>::EndOfInput:
ret << "EndOfInput";
@@ -39,7 +39,7 @@ DebugUtils::process_context_flag_name (FlagField::Flag flag)
ret << flag;
break;
}
-
+
return ret.str();
}
diff --git a/libs/audiographer/src/general/normalizer.cc b/libs/audiographer/src/general/normalizer.cc
index 5497c2ab14..d241d71892 100644
--- a/libs/audiographer/src/general/normalizer.cc
+++ b/libs/audiographer/src/general/normalizer.cc
@@ -30,7 +30,7 @@ Normalizer::Normalizer (float target_dB)
{
target = pow (10.0f, target_dB * 0.05f);
}
-
+
Normalizer::~Normalizer()
{
delete [] buffer;
@@ -66,12 +66,12 @@ void Normalizer::process (ProcessContext<float> const & c)
if (throw_level (ThrowProcess) && c.frames() > buffer_size) {
throw Exception (*this, "Too many frames given to process()");
}
-
+
if (enabled) {
memcpy (buffer, c.data(), c.frames() * sizeof(float));
Routines::apply_gain_to_buffer (buffer, c.frames(), gain);
}
-
+
ProcessContext<float> c_out (c, buffer);
ListedSource<float>::output (c_out);
}
diff --git a/libs/audiographer/src/general/sample_format_converter.cc b/libs/audiographer/src/general/sample_format_converter.cc
index a04ebfc25c..1f79818a8b 100644
--- a/libs/audiographer/src/general/sample_format_converter.cc
+++ b/libs/audiographer/src/general/sample_format_converter.cc
@@ -120,11 +120,11 @@ SampleFormatConverter<TOut>::reset()
gdither_free (dither);
dither = 0;
}
-
+
delete[] data_out;
data_out_size = 0;
data_out = 0;
-
+
clip_floats = false;
}
@@ -134,7 +134,7 @@ void
SampleFormatConverter<TOut>::process (ProcessContext<float> const & c_in)
{
float const * const data = c_in.data();
-
+
check_frame_and_channel_count (c_in.frames (), c_in.channels ());
/* Do conversion */
@@ -164,7 +164,7 @@ SampleFormatConverter<float>::process (ProcessContext<float> & c_in)
{
framecnt_t frames = c_in.frames();
float * data = c_in.data();
-
+
if (clip_floats) {
for (framecnt_t x = 0; x < frames; ++x) {
if (data[x] > 1.0f) {
@@ -186,7 +186,7 @@ SampleFormatConverter<float>::process (ProcessContext<float> const & c_in)
// Make copy of data and pass it to non-const version
check_frame_and_channel_count (c_in.frames(), c_in.channels());
TypeUtils<float>::copy (c_in.data(), data_out, c_in.frames());
-
+
ProcessContext<float> c (c_in, data_out);
process (c);
}
@@ -200,7 +200,7 @@ SampleFormatConverter<TOut>::check_frame_and_channel_count (framecnt_t frames, C
("Wrong channel count given to process(), %1% instead of %2%")
% channels_ % channels));
}
-
+
if (throw_level (ThrowProcess) && frames > data_out_size) {
throw Exception (*this, boost::str (boost::format
("Too many frames given to process(), %1% instad of %2%")
diff --git a/libs/audiographer/src/general/sr_converter.cc b/libs/audiographer/src/general/sr_converter.cc
index 512e57a743..90de3e58d7 100644
--- a/libs/audiographer/src/general/sr_converter.cc
+++ b/libs/audiographer/src/general/sr_converter.cc
@@ -49,7 +49,7 @@ void
SampleRateConverter::init (framecnt_t in_rate, framecnt_t out_rate, int quality)
{
reset();
-
+
if (in_rate == out_rate) {
src_data.src_ratio = 1;
return;
@@ -76,7 +76,7 @@ framecnt_t
SampleRateConverter::allocate_buffers (framecnt_t max_frames)
{
if (!active) { return max_frames; }
-
+
framecnt_t max_frames_out = (framecnt_t) ceil (max_frames * src_data.src_ratio);
if (data_out_size < max_frames_out) {
@@ -93,7 +93,7 @@ SampleRateConverter::allocate_buffers (framecnt_t max_frames)
max_frames_in = max_frames;
data_out_size = max_frames_out;
}
-
+
return max_frames_out;
}
@@ -101,7 +101,7 @@ void
SampleRateConverter::process (ProcessContext<float> const & c)
{
check_flags (*this, c);
-
+
if (!active) {
output (c);
return;
@@ -158,7 +158,7 @@ SampleRateConverter::process (ProcessContext<float> const & c)
", data_out: " << src_data.data_out <<
", output_frames: " << src_data.output_frames << std::endl;
}
-
+
err = src_process (src_state, &src_data);
if (throw_level (ThrowProcess) && err) {
throw Exception (*this, str (format
@@ -193,9 +193,9 @@ SampleRateConverter::process (ProcessContext<float> const & c)
("No output frames genereated with %1% leftover frames")
% leftover_frames));
}
-
+
} while (leftover_frames > frames);
-
+
// src_data.end_of_input has to be checked to prevent infinite recursion
if (!src_data.end_of_input && c.has_flag(ProcessContext<float>::EndOfInput)) {
set_end_of_input (c);
@@ -205,10 +205,10 @@ SampleRateConverter::process (ProcessContext<float> const & c)
void SampleRateConverter::set_end_of_input (ProcessContext<float> const & c)
{
src_data.end_of_input = true;
-
+
float f;
ProcessContext<float> const dummy (c, &f, 0, channels);
-
+
/* No idea why this has to be done twice for all data to be written,
* but that just seems to be the way it is...
*/
@@ -224,17 +224,17 @@ void SampleRateConverter::reset ()
active = false;
max_frames_in = 0;
src_data.end_of_input = false;
-
+
if (src_state) {
src_delete (src_state);
}
-
+
leftover_frames = 0;
max_leftover_frames = 0;
if (leftover_data) {
free (leftover_data);
}
-
+
data_out_size = 0;
delete [] data_out;
data_out = 0;
diff --git a/libs/audiographer/tests/general/chunker_test.cc b/libs/audiographer/tests/general/chunker_test.cc
index d3adab3691..12b5da5dbc 100644
--- a/libs/audiographer/tests/general/chunker_test.cc
+++ b/libs/audiographer/tests/general/chunker_test.cc
@@ -35,52 +35,52 @@ class ChunkerTest : public CppUnit::TestFixture
{
chunker->add_output (sink);
framecnt_t frames_output = 0;
-
+
ProcessContext<float> const context (random_data, frames, 1);
-
+
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
-
+
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (2 * frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, &sink->get_array()[frames], frames));
-
+
sink->reset();
-
+
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
-
+
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (2 * frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, &sink->get_array()[frames], frames));
}
-
+
void testAsynchronousProcess()
{
assert (frames % 2 == 0);
-
+
chunker->add_output (sink);
framecnt_t frames_output = 0;
-
+
ProcessContext<float> const half_context (random_data, frames / 2, 1);
ProcessContext<float> const context (random_data, frames, 1);
-
+
// 0.5
chunker->process (half_context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
-
+
// 1.5
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
-
+
// 2.5
chunker->process (context);
frames_output = sink->get_data().size();
@@ -88,14 +88,14 @@ class ChunkerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink->get_array(), frames / 2));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, &sink->get_array()[frames / 2], frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, &sink->get_array()[ 3 * frames / 2], frames / 2));
-
+
sink->reset();
-
+
// 3.5
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_output);
-
+
// 4.0
chunker->process (half_context);
frames_output = sink->get_data().size();
@@ -104,30 +104,30 @@ class ChunkerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, &sink->get_array()[frames / 2], frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, &sink->get_array()[ 3 * frames / 2], frames / 2));
}
-
+
void testChoppingProcess()
{
sink.reset (new AppendingVectorSink<float>());
-
+
assert (frames % 2 == 0);
chunker.reset (new Chunker<float>(frames / 4));
-
+
chunker->add_output (sink);
framecnt_t frames_output = 0;
-
+
ProcessContext<float> const half_context (random_data, frames / 2, 1);
ProcessContext<float> const context (random_data, frames, 1);
-
+
// 0.5
chunker->process (half_context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) frames / 2, frames_output);
-
+
// 1.5
chunker->process (context);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) frames / 2 * 3, frames_output);
-
+
// 2.5
chunker->process (context);
frames_output = sink->get_data().size();
@@ -140,15 +140,15 @@ class ChunkerTest : public CppUnit::TestFixture
void testEndOfInputFlagHandling()
{
boost::shared_ptr<ProcessContextGrabber<float> > grabber(new ProcessContextGrabber<float>());
-
+
assert (frames % 2 == 0);
chunker.reset (new Chunker<float>(frames));
chunker->add_output (grabber);
-
+
ProcessContext<float> const half_context (random_data, frames / 2, 1);
ProcessContext<float> const context (random_data, frames, 1);
context.set_flag(ProcessContext<>::EndOfInput);
-
+
// Process 0.5 then 1.0
chunker->process (half_context);
chunker->process (context);
diff --git a/libs/audiographer/tests/general/deinterleaver_test.cc b/libs/audiographer/tests/general/deinterleaver_test.cc
index 3260045b11..f7e15459b3 100644
--- a/libs/audiographer/tests/general/deinterleaver_test.cc
+++ b/libs/audiographer/tests/general/deinterleaver_test.cc
@@ -48,15 +48,15 @@ class DeInterleaverTest : public CppUnit::TestFixture
void testInvalidInputSize()
{
deinterleaver->init (channels, frames_per_channel);
-
+
ProcessContext<float> c (random_data, 2 * total_frames, channels);
-
+
// Too many, frames % channels == 0
CPPUNIT_ASSERT_THROW (deinterleaver->process (c.beginning (total_frames + channels)), Exception);
-
+
// Too many, frames % channels != 0
CPPUNIT_ASSERT_THROW (deinterleaver->process (c.beginning (total_frames + 1)), Exception);
-
+
// Too few, frames % channels != 0
CPPUNIT_ASSERT_THROW (deinterleaver->process (c.beginning (total_frames - 1)), Exception);
}
@@ -64,13 +64,13 @@ class DeInterleaverTest : public CppUnit::TestFixture
void assert_outputs (framecnt_t expected_frames)
{
framecnt_t generated_frames = 0;
-
+
generated_frames = sink_a->get_data().size();
CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames);
-
+
generated_frames = sink_b->get_data().size();
CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames);
-
+
generated_frames = sink_c->get_data().size();
CPPUNIT_ASSERT_EQUAL (expected_frames, generated_frames);
}
@@ -78,34 +78,34 @@ class DeInterleaverTest : public CppUnit::TestFixture
void testOutputSize()
{
deinterleaver->init (channels, frames_per_channel);
-
+
deinterleaver->output (0)->add_output (sink_a);
deinterleaver->output (1)->add_output (sink_b);
deinterleaver->output (2)->add_output (sink_c);
-
+
// Test maximum frame input
ProcessContext<float> c (random_data, total_frames, channels);
deinterleaver->process (c);
assert_outputs (frames_per_channel);
-
+
// Now with less frames
framecnt_t const less_frames = frames_per_channel / 4;
deinterleaver->process (c.beginning (less_frames * channels));
assert_outputs (less_frames);
}
-
+
void testZeroInput()
{
deinterleaver->init (channels, frames_per_channel);
-
+
deinterleaver->output (0)->add_output (sink_a);
deinterleaver->output (1)->add_output (sink_b);
deinterleaver->output (2)->add_output (sink_c);
-
+
// Input zero frames
ProcessContext<float> c (random_data, total_frames, channels);
deinterleaver->process (c.beginning (0));
-
+
// ...and now test regular input
deinterleaver->process (c);
assert_outputs (frames_per_channel);
diff --git a/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc b/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc
index da042b9494..4f46a83492 100644
--- a/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc
+++ b/libs/audiographer/tests/general/interleaver_deinterleaver_test.cc
@@ -18,14 +18,14 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture
channels = 3;
frames_per_channel = 128;
total_frames = channels * frames_per_channel;
-
+
random_data_a = TestUtils::init_random_data (total_frames, 1.0);
random_data_b = TestUtils::init_random_data (frames_per_channel, 1.0);
random_data_c = TestUtils::init_random_data (frames_per_channel, 1.0);
deinterleaver.reset (new DeInterleaver<float>());
interleaver.reset (new Interleaver<float>());
-
+
sink_a.reset (new VectorSink<float>());
sink_b.reset (new VectorSink<float>());
sink_c.reset (new VectorSink<float>());
@@ -42,64 +42,64 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture
{
deinterleaver->init (channels, frames_per_channel);
interleaver->init (channels, frames_per_channel);
-
+
deinterleaver->output (0)->add_output (interleaver->input (0));
deinterleaver->output (1)->add_output (interleaver->input (1));
deinterleaver->output (2)->add_output (interleaver->input (2));
-
+
interleaver->add_output (sink_a);
-
+
// Process and assert
ProcessContext<float> c (random_data_a, total_frames, channels);
deinterleaver->process (c);
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), total_frames));
-
+
// And a second round...
framecnt_t less_frames = (frames_per_channel / 10) * channels;
deinterleaver->process (c.beginning (less_frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), less_frames));
}
-
+
void testDeInterleavedInput()
{
deinterleaver->init (channels, frames_per_channel);
interleaver->init (channels, frames_per_channel);
-
+
interleaver->add_output (deinterleaver);
-
+
deinterleaver->output (0)->add_output (sink_a);
deinterleaver->output (1)->add_output (sink_b);
deinterleaver->output (2)->add_output (sink_c);
-
+
ProcessContext<float> c_a (random_data_a, frames_per_channel, 1);
ProcessContext<float> c_b (random_data_b, frames_per_channel, 1);
ProcessContext<float> c_c (random_data_c, frames_per_channel, 1);
-
+
// Process and assert
interleaver->input (0)->process (c_a);
interleaver->input (1)->process (c_b);
interleaver->input (2)->process (c_c);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), frames_per_channel));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_b, sink_b->get_array(), frames_per_channel));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_c, sink_c->get_array(), frames_per_channel));
-
+
// And a second round...
framecnt_t less_frames = frames_per_channel / 5;
interleaver->input (0)->process (c_a.beginning (less_frames));
interleaver->input (1)->process (c_b.beginning (less_frames));
interleaver->input (2)->process (c_c.beginning (less_frames));
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_a, sink_a->get_array(), less_frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_b, sink_b->get_array(), less_frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data_c, sink_c->get_array(), less_frames));
-
+
}
private:
boost::shared_ptr<Interleaver<float> > interleaver;
boost::shared_ptr<DeInterleaver<float> > deinterleaver;
-
+
boost::shared_ptr<VectorSink<float> > sink_a;
boost::shared_ptr<VectorSink<float> > sink_b;
boost::shared_ptr<VectorSink<float> > sink_c;
@@ -107,7 +107,7 @@ class InterleaverDeInterleaverTest : public CppUnit::TestFixture
float * random_data_a;
float * random_data_b;
float * random_data_c;
-
+
framecnt_t frames_per_channel;
framecnt_t total_frames;
unsigned int channels;
diff --git a/libs/audiographer/tests/general/interleaver_test.cc b/libs/audiographer/tests/general/interleaver_test.cc
index b82aac74bb..0b8f8b6952 100644
--- a/libs/audiographer/tests/general/interleaver_test.cc
+++ b/libs/audiographer/tests/general/interleaver_test.cc
@@ -24,7 +24,7 @@ class InterleaverTest : public CppUnit::TestFixture
interleaver.reset (new Interleaver<float>());
sink.reset (new VectorSink<float>());
-
+
interleaver->init (channels, frames);
}
@@ -50,7 +50,7 @@ class InterleaverTest : public CppUnit::TestFixture
{
ProcessContext<float> c (random_data, frames + 1, 1);
CPPUNIT_ASSERT_THROW (interleaver->input (0)->process (c), Exception);
-
+
interleaver->input (0)->process (c.beginning (frames));
interleaver->input (1)->process (c.beginning (frames));
CPPUNIT_ASSERT_THROW (interleaver->input (2)->process (c.beginning (frames - 1)), Exception);
@@ -92,9 +92,9 @@ class InterleaverTest : public CppUnit::TestFixture
interleaver->input (0)->process (c.beginning (0));
interleaver->input (1)->process (c.beginning (0));
interleaver->input (2)->process (c.beginning (0));
-
+
// NOTE zero input is allowed to be a NOP
-
+
// ...now test regular input
interleaver->input (0)->process (c);
interleaver->input (1)->process (c);
@@ -110,7 +110,7 @@ class InterleaverTest : public CppUnit::TestFixture
interleaver->add_output (sink);
ProcessContext<float> c (random_data, frames, 1);
interleaver->input (0)->process (c);
- CPPUNIT_ASSERT_THROW (interleaver->input (0)->process (c), Exception);
+ CPPUNIT_ASSERT_THROW (interleaver->input (0)->process (c), Exception);
}
diff --git a/libs/audiographer/tests/general/normalizer_test.cc b/libs/audiographer/tests/general/normalizer_test.cc
index be23680202..fb8cd617c2 100644
--- a/libs/audiographer/tests/general/normalizer_test.cc
+++ b/libs/audiographer/tests/general/normalizer_test.cc
@@ -26,24 +26,24 @@ class NormalizerTest : public CppUnit::TestFixture
{
float target = 0.0;
random_data = TestUtils::init_random_data(frames, 0.5);
-
+
normalizer.reset (new Normalizer(target));
peak_reader.reset (new PeakReader());
sink.reset (new VectorSink<float>());
-
+
ProcessContext<float> const c (random_data, frames, 1);
peak_reader->process (c);
-
+
float peak = peak_reader->get_peak();
normalizer->alloc_buffer (frames);
normalizer->set_peak (peak);
normalizer->add_output (sink);
normalizer->process (c);
-
+
peak_reader->reset();
ConstProcessContext<float> normalized (sink->get_array(), frames, 1);
peak_reader->process (normalized);
-
+
peak = peak_reader->get_peak();
CPPUNIT_ASSERT (-FLT_EPSILON <= (peak - 1.0) && (peak - 1.0) <= 0.0);
}
diff --git a/libs/audiographer/tests/general/peak_reader_test.cc b/libs/audiographer/tests/general/peak_reader_test.cc
index 6b60598a2e..a93d28a954 100644
--- a/libs/audiographer/tests/general/peak_reader_test.cc
+++ b/libs/audiographer/tests/general/peak_reader_test.cc
@@ -26,17 +26,17 @@ class PeakReaderTest : public CppUnit::TestFixture
{
reader.reset (new PeakReader());
ProcessContext<float> c (random_data, frames, 1);
-
+
float peak = 1.5;
random_data[10] = peak;
reader->process (c);
CPPUNIT_ASSERT_EQUAL(peak, reader->get_peak());
-
+
peak = 2.0;
random_data[10] = peak;
reader->process (c);
CPPUNIT_ASSERT_EQUAL(peak, reader->get_peak());
-
+
peak = -2.1;
random_data[10] = peak;
reader->process (c);
diff --git a/libs/audiographer/tests/general/sample_format_converter_test.cc b/libs/audiographer/tests/general/sample_format_converter_test.cc
index 977e2b390a..734389a427 100644
--- a/libs/audiographer/tests/general/sample_format_converter_test.cc
+++ b/libs/audiographer/tests/general/sample_format_converter_test.cc
@@ -63,25 +63,25 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
{
boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1));
boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
-
+
converter->init (frames, D_Tri, 32);
converter->add_output (sink);
framecnt_t frames_output = 0;
-
+
{
ProcessContext<float> pc(random_data, frames / 2, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames / 2, frames_output);
}
-
+
{
ProcessContext<float> pc(random_data, frames, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
}
-
+
{
ProcessContext<float> pc(random_data, frames + 1, 1);
CPPUNIT_ASSERT_THROW(converter->process (pc), Exception);
@@ -93,27 +93,27 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
boost::shared_ptr<SampleFormatConverter<float> > converter (new SampleFormatConverter<float>(1));
boost::shared_ptr<VectorSink<float> > sink (new VectorSink<float>());
framecnt_t frames_output = 0;
-
+
converter->init(frames, D_Tri, 32);
converter->add_output (sink);
-
+
converter->set_clip_floats (false);
ProcessContext<float> const pc(random_data, frames, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_equals(sink->get_array(), random_data, frames));
-
+
// Make sure a few samples are < -1.0 and > 1.0
random_data[10] = -1.5;
random_data[20] = 1.5;
-
+
converter->set_clip_floats (true);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames));
-
+
for (framecnt_t i = 0; i < frames; ++i) {
// fp comparison needs a bit of tolerance, 1.01 << 1.5
CPPUNIT_ASSERT(sink->get_data()[i] < 1.01);
@@ -126,77 +126,77 @@ class SampleFormatConverterTest : public CppUnit::TestFixture
boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1));
boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
framecnt_t frames_output = 0;
-
+
converter->init(frames, D_Tri, 32);
converter->add_output (sink);
-
+
ProcessContext<float> pc(random_data, frames, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames));
}
-
+
void testInt24()
{
boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(1));
boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
framecnt_t frames_output = 0;
-
+
converter->init(frames, D_Tri, 24);
converter->add_output (sink);
-
+
ProcessContext<float> pc(random_data, frames, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames));
}
-
+
void testInt16()
{
boost::shared_ptr<SampleFormatConverter<int16_t> > converter (new SampleFormatConverter<int16_t>(1));
boost::shared_ptr<VectorSink<int16_t> > sink (new VectorSink<int16_t>());
framecnt_t frames_output = 0;
-
+
converter->init(frames, D_Tri, 16);
converter->add_output (sink);
-
+
ProcessContext<float> pc(random_data, frames, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames));
}
-
+
void testUint8()
{
boost::shared_ptr<SampleFormatConverter<uint8_t> > converter (new SampleFormatConverter<uint8_t>(1));
boost::shared_ptr<VectorSink<uint8_t> > sink (new VectorSink<uint8_t>());
framecnt_t frames_output = 0;
-
+
converter->init(frames, D_Tri, 8);
converter->add_output (sink);
-
+
ProcessContext<float> pc(random_data, frames, 1);
converter->process (pc);
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
CPPUNIT_ASSERT (TestUtils::array_filled(sink->get_array(), frames));
}
-
+
void testChannelCount()
{
boost::shared_ptr<SampleFormatConverter<int32_t> > converter (new SampleFormatConverter<int32_t>(3));
boost::shared_ptr<VectorSink<int32_t> > sink (new VectorSink<int32_t>());
framecnt_t frames_output = 0;
-
+
converter->init(frames, D_Tri, 32);
converter->add_output (sink);
-
+
ProcessContext<float> pc(random_data, 4, 1);
CPPUNIT_ASSERT_THROW (converter->process (pc), Exception);
-
+
framecnt_t new_frame_count = frames - (frames % 3);
converter->process (ProcessContext<float> (pc.data(), new_frame_count, 3));
frames_output = sink->get_data().size();
diff --git a/libs/audiographer/tests/general/silence_trimmer_test.cc b/libs/audiographer/tests/general/silence_trimmer_test.cc
index dfcf3c7ca2..be53c89978 100644
--- a/libs/audiographer/tests/general/silence_trimmer_test.cc
+++ b/libs/audiographer/tests/general/silence_trimmer_test.cc
@@ -18,20 +18,20 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
void setUp()
{
frames = 128;
-
+
random_data = TestUtils::init_random_data(frames);
random_data[0] = 0.5;
random_data[frames - 1] = 0.5;
-
+
zero_data = new float[frames];
memset(zero_data, 0, frames * sizeof(float));
-
+
half_random_data = TestUtils::init_random_data(frames);
memset(half_random_data, 0, (frames / 2) * sizeof(float));
-
+
trimmer.reset (new SilenceTrimmer<float> (frames / 2));
sink.reset (new AppendingVectorSink<float>());
-
+
trimmer->set_trim_beginning (true);
trimmer->set_trim_end (true);
}
@@ -46,14 +46,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
void testFullBuffers()
{
trimmer->add_output (sink);
-
+
{
ProcessContext<float> c (zero_data, frames, 1);
trimmer->process (c);
framecnt_t frames_processed = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL ((framecnt_t) 0, frames_processed);
}
-
+
{
ProcessContext<float> c (random_data, frames, 1);
trimmer->process (c);
@@ -61,14 +61,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL (frames, frames_processed);
CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), random_data, frames));
}
-
+
{
ProcessContext<float> c (zero_data, frames, 1);
trimmer->process (c);
framecnt_t frames_processed = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_processed);
}
-
+
{
ProcessContext<float> c (random_data, frames, 1);
trimmer->process (c);
@@ -78,7 +78,7 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames], zero_data, frames));
CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[2 * frames], random_data, frames));
}
-
+
{
ProcessContext<float> c (zero_data, frames, 1);
trimmer->process (c);
@@ -86,14 +86,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL (3 * frames, frames_processed);
}
}
-
+
void testPartialBuffers()
{
trimmer->add_output (sink);
trimmer->reset (frames / 4);
trimmer->set_trim_beginning (true);
trimmer->set_trim_end (true);
-
+
{
ProcessContext<float> c (half_random_data, frames, 1);
trimmer->process (c);
@@ -101,14 +101,14 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed);
CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), &half_random_data[frames / 2], frames / 2));
}
-
+
{
ProcessContext<float> c (zero_data, frames, 1);
trimmer->process (c);
framecnt_t frames_processed = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed);
}
-
+
{
ProcessContext<float> c (half_random_data, frames, 1);
trimmer->process (c);
@@ -117,48 +117,48 @@ class SilenceTrimmerTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[frames + frames / 2], half_random_data, frames));
}
}
-
+
void testExceptions()
{
{
CPPUNIT_ASSERT_THROW (trimmer->reset (0), Exception);
}
}
-
+
void testAddSilenceBeginning()
{
trimmer->add_output (sink);
-
+
framecnt_t silence = frames / 2;
trimmer->add_silence_to_beginning (silence);
-
+
{
ProcessContext<float> c (random_data, frames, 1);
trimmer->process (c);
}
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (sink->get_array(), zero_data, silence));
CPPUNIT_ASSERT (TestUtils::array_equals (&sink->get_array()[silence], random_data, frames));
}
-
+
void testAddSilenceEnd()
{
trimmer->add_output (sink);
-
+
framecnt_t silence = frames / 3;
trimmer->add_silence_to_end (silence);
-
+
{
ProcessContext<float> c (random_data, frames, 1);
trimmer->process (c);
}
-
+
{
ProcessContext<float> c (random_data, frames, 1);
c.set_flag (ProcessContext<float>::EndOfInput);
trimmer->process (c);
}
-
+
framecnt_t frames_processed = sink->get_data().size();
framecnt_t total_frames = 2 * frames + silence;
CPPUNIT_ASSERT_EQUAL (total_frames, frames_processed);
diff --git a/libs/audiographer/tests/general/sr_converter_test.cc b/libs/audiographer/tests/general/sr_converter_test.cc
index 75834127f5..4f5afbb620 100644
--- a/libs/audiographer/tests/general/sr_converter_test.cc
+++ b/libs/audiographer/tests/general/sr_converter_test.cc
@@ -33,19 +33,19 @@ class SampleRateConverterTest : public CppUnit::TestFixture
assert (frames % 2 == 0);
framecnt_t const half_frames = frames / 2;
framecnt_t frames_output = 0;
-
+
converter->init (44100, 44100);
converter->add_output (sink);
-
+
ProcessContext<float> c (random_data, half_frames, 1);
converter->process (c);
ProcessContext<float> c2 (&random_data[half_frames], half_frames, 1);
c2.set_flag (ProcessContext<float>::EndOfInput);
converter->process (c2);
-
+
frames_output = sink->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink->get_array(), frames));
}
@@ -54,11 +54,11 @@ class SampleRateConverterTest : public CppUnit::TestFixture
assert (frames % 2 == 0);
framecnt_t const half_frames = frames / 2;
framecnt_t frames_output = 0;
-
+
converter->init (44100, 88200);
converter->allocate_buffers (half_frames);
converter->add_output (sink);
-
+
ProcessContext<float> c (random_data, half_frames, 1);
converter->process (c);
ProcessContext<float> c2 (&random_data[half_frames], half_frames, 1);
@@ -75,37 +75,37 @@ class SampleRateConverterTest : public CppUnit::TestFixture
assert (frames % 2 == 0);
framecnt_t const half_frames = frames / 2;
framecnt_t frames_output = 0;
-
+
converter->init (88200, 44100);
converter->allocate_buffers (half_frames);
converter->add_output (sink);
-
+
ProcessContext<float> c (random_data, half_frames, 1);
converter->process (c);
ProcessContext<float> c2 (&random_data[half_frames], half_frames, 1);
c2.set_flag (ProcessContext<float>::EndOfInput);
converter->process (c2);
-
+
frames_output = sink->get_data().size();
framecnt_t tolerance = 3;
CPPUNIT_ASSERT (half_frames - tolerance < frames_output && frames_output < half_frames + tolerance);
}
-
+
void testRespectsEndOfInput()
{
assert (frames % 2 == 0);
framecnt_t const half_frames = frames / 2;
-
+
converter->init (44100, 48000);
converter->allocate_buffers (half_frames);
converter->add_output (grabber);
-
+
ProcessContext<float> c (random_data, half_frames, 1);
converter->process (c);
ProcessContext<float> c2 (&random_data[half_frames], half_frames / 2, 1);
c2.set_flag (ProcessContext<float>::EndOfInput);
converter->process (c2);
-
+
for (std::list<ProcessContext<float> >::iterator it = grabber->contexts.begin(); it != grabber->contexts.end(); ++it) {
std::list<ProcessContext<float> >::iterator next = it; ++next;
if (next == grabber->contexts.end()) {
@@ -115,7 +115,7 @@ class SampleRateConverterTest : public CppUnit::TestFixture
}
}
}
-
+
private:
boost::shared_ptr<SampleRateConverter > converter;
diff --git a/libs/audiographer/tests/general/threader_test.cc b/libs/audiographer/tests/general/threader_test.cc
index 1e87c8d34d..cdb21a375b 100644
--- a/libs/audiographer/tests/general/threader_test.cc
+++ b/libs/audiographer/tests/general/threader_test.cc
@@ -18,20 +18,20 @@ class ThreaderTest : public CppUnit::TestFixture
{
frames = 128;
random_data = TestUtils::init_random_data (frames, 1.0);
-
+
zero_data = new float[frames];
memset (zero_data, 0, frames * sizeof(float));
-
+
thread_pool = new Glib::ThreadPool (3);
threader.reset (new Threader<float> (*thread_pool));
-
+
sink_a.reset (new VectorSink<float>());
sink_b.reset (new VectorSink<float>());
sink_c.reset (new VectorSink<float>());
sink_d.reset (new VectorSink<float>());
sink_e.reset (new VectorSink<float>());
sink_f.reset (new VectorSink<float>());
-
+
throwing_sink.reset (new ThrowingSink<float>());
}
@@ -39,7 +39,7 @@ class ThreaderTest : public CppUnit::TestFixture
{
delete [] random_data;
delete [] zero_data;
-
+
thread_pool->shutdown();
delete thread_pool;
}
@@ -52,10 +52,10 @@ class ThreaderTest : public CppUnit::TestFixture
threader->add_output (sink_d);
threader->add_output (sink_e);
threader->add_output (sink_f);
-
+
ProcessContext<float> c (random_data, frames, 1);
threader->process (c);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_b->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_c->get_array(), frames));
@@ -63,7 +63,7 @@ class ThreaderTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_e->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_f->get_array(), frames));
}
-
+
void testRemoveOutput()
{
threader->add_output (sink_a);
@@ -72,18 +72,18 @@ class ThreaderTest : public CppUnit::TestFixture
threader->add_output (sink_d);
threader->add_output (sink_e);
threader->add_output (sink_f);
-
+
ProcessContext<float> c (random_data, frames, 1);
threader->process (c);
-
+
// Remove a, b and f
threader->remove_output (sink_a);
threader->remove_output (sink_b);
threader->remove_output (sink_f);
-
+
ProcessContext<float> zc (zero_data, frames, 1);
threader->process (zc);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_b->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(zero_data, sink_c->get_array(), frames));
@@ -91,7 +91,7 @@ class ThreaderTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals(zero_data, sink_e->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_f->get_array(), frames));
}
-
+
void testClearOutputs()
{
threader->add_output (sink_a);
@@ -100,14 +100,14 @@ class ThreaderTest : public CppUnit::TestFixture
threader->add_output (sink_d);
threader->add_output (sink_e);
threader->add_output (sink_f);
-
+
ProcessContext<float> c (random_data, frames, 1);
threader->process (c);
-
+
threader->clear_outputs();
ProcessContext<float> zc (zero_data, frames, 1);
threader->process (zc);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_b->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_c->get_array(), frames));
@@ -115,7 +115,7 @@ class ThreaderTest : public CppUnit::TestFixture
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_e->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_f->get_array(), frames));
}
-
+
void testExceptions()
{
threader->add_output (sink_a);
@@ -124,10 +124,10 @@ class ThreaderTest : public CppUnit::TestFixture
threader->add_output (throwing_sink);
threader->add_output (sink_e);
threader->add_output (throwing_sink);
-
+
ProcessContext<float> c (random_data, frames, 1);
CPPUNIT_ASSERT_THROW (threader->process (c), Exception);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_b->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals(random_data, sink_c->get_array(), frames));
@@ -136,7 +136,7 @@ class ThreaderTest : public CppUnit::TestFixture
private:
Glib::ThreadPool * thread_pool;
-
+
boost::shared_ptr<Threader<float> > threader;
boost::shared_ptr<VectorSink<float> > sink_a;
boost::shared_ptr<VectorSink<float> > sink_b;
@@ -144,7 +144,7 @@ class ThreaderTest : public CppUnit::TestFixture
boost::shared_ptr<VectorSink<float> > sink_d;
boost::shared_ptr<VectorSink<float> > sink_e;
boost::shared_ptr<VectorSink<float> > sink_f;
-
+
boost::shared_ptr<ThrowingSink<float> > throwing_sink;
float * random_data;
diff --git a/libs/audiographer/tests/sndfile/tmp_file_test.cc b/libs/audiographer/tests/sndfile/tmp_file_test.cc
index 9ce8af7a5c..32e39135ec 100644
--- a/libs/audiographer/tests/sndfile/tmp_file_test.cc
+++ b/libs/audiographer/tests/sndfile/tmp_file_test.cc
@@ -28,9 +28,9 @@ class TmpFileTest : public CppUnit::TestFixture
AllocatingProcessContext<float> c (random_data, frames, channels);
c.set_flag (ProcessContext<float>::EndOfInput);
file->process (c);
-
+
TypeUtils<float>::zero_fill (c.data (), c.frames());
-
+
file->seek (0, SEEK_SET);
file->read (c);
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, c.data(), c.frames()));
diff --git a/libs/audiographer/tests/type_utils_test.cc b/libs/audiographer/tests/type_utils_test.cc
index a2b2c96f11..1ae7b28451 100644
--- a/libs/audiographer/tests/type_utils_test.cc
+++ b/libs/audiographer/tests/type_utils_test.cc
@@ -17,12 +17,12 @@ class TypeUtilsTest : public CppUnit::TestFixture
public:
void setUp()
{
-
+
}
void tearDown()
{
-
+
}
void testZeroFillPod()
@@ -35,7 +35,7 @@ class TypeUtilsTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL (zero, buf[i]);
}
}
-
+
void testZeroFillNonPod()
{
/* does not compile on OS X Lion
@@ -48,26 +48,26 @@ class TypeUtilsTest : public CppUnit::TestFixture
}
*/
}
-
+
void testMoveBackward()
{
int seq[8] = { 0, 1, 2, 3,
4, 5, 6, 7 };
-
+
TypeUtils<int>::move (&seq[4], &seq[2], 4);
-
+
for (int i = 2; i < 2 + 4; ++i) {
CPPUNIT_ASSERT_EQUAL (i + 2, seq[i]);
}
}
-
+
void testMoveForward()
{
int seq[8] = { 0, 1, 2, 3,
4, 5, 6, 7 };
-
+
TypeUtils<int>::move (&seq[2], &seq[4], 4);
-
+
for (int i = 4; i < 4 + 4; ++i) {
CPPUNIT_ASSERT_EQUAL (i - 2, seq[i]);
}
@@ -79,16 +79,16 @@ class TypeUtilsTest : public CppUnit::TestFixture
int const seq2[4] = { 5, 6, 7, 8 };
int seq3[8] = { 0, 0, 0, 0,
0, 0, 0, 0 };
-
+
TypeUtils<int>::copy (seq1, seq3, 4);
for (int i = 0; i < 4; ++i) {
CPPUNIT_ASSERT_EQUAL (seq1[i], seq3[i]);
}
-
+
for (int i = 4; i < 8; ++i) {
CPPUNIT_ASSERT_EQUAL (0, seq3[i]);
}
-
+
TypeUtils<int>::copy (seq2, &seq3[4], 4);
for (int i = 0; i < 4; ++i) {
CPPUNIT_ASSERT_EQUAL (seq1[i], seq3[i]);
@@ -99,14 +99,14 @@ class TypeUtilsTest : public CppUnit::TestFixture
}
private:
-
+
struct NonPodType {
NonPodType() : data (42) {}
bool operator== (NonPodType const & other) const
{ return data == other.data; }
int data;
};
-
+
};
diff --git a/libs/audiographer/tests/utils.h b/libs/audiographer/tests/utils.h
index 2955f51102..b6b9e0136c 100644
--- a/libs/audiographer/tests/utils.h
+++ b/libs/audiographer/tests/utils.h
@@ -49,7 +49,7 @@ struct TestUtils
unsigned int const granularity = 4096;
float * data = new float[frames];
srand (std::time (NULL));
-
+
for (framecnt_t i = 0; i < frames; ++i) {
do {
int biased_int = (rand() % granularity) - (granularity / 2);
@@ -127,10 +127,10 @@ class ProcessContextGrabber : public AudioGrapher::Sink<T>
contexts.push_back (c);
}
using AudioGrapher::Sink<T>::process;
-
+
typedef std::list<AudioGrapher::ProcessContext<T> > ContextList;
ContextList contexts;
-
+
};
#endif // AUDIOGRAPHER_TESTS_UTILS_H
diff --git a/libs/audiographer/tests/utils/identity_vertex_test.cc b/libs/audiographer/tests/utils/identity_vertex_test.cc
index 799dcca386..3c0fd71c70 100644
--- a/libs/audiographer/tests/utils/identity_vertex_test.cc
+++ b/libs/audiographer/tests/utils/identity_vertex_test.cc
@@ -17,7 +17,7 @@ class IdentityVertexTest : public CppUnit::TestFixture
{
frames = 128;
random_data = TestUtils::init_random_data(frames);
-
+
zero_data = new float[frames];
memset (zero_data, 0, frames * sizeof(float));
@@ -36,52 +36,52 @@ class IdentityVertexTest : public CppUnit::TestFixture
vertex.reset (new IdentityVertex<float>());
vertex->add_output (sink_a);
vertex->add_output (sink_b);
-
+
framecnt_t frames_output = 0;
-
+
ProcessContext<float> c (random_data, frames, 1);
vertex->process (c);
-
+
frames_output = sink_a->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
-
+
frames_output = sink_b->get_data().size();
CPPUNIT_ASSERT_EQUAL (frames, frames_output);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink_b->get_array(), frames));
}
-
+
void testRemoveOutput()
{
vertex.reset (new IdentityVertex<float>());
vertex->add_output (sink_a);
vertex->add_output (sink_b);
-
+
ProcessContext<float> c (random_data, frames, 1);
vertex->process (c);
-
+
vertex->remove_output (sink_a);
ProcessContext<float> zc (zero_data, frames, 1);
vertex->process (zc);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals (zero_data, sink_b->get_array(), frames));
}
-
+
void testClearOutputs()
{
vertex.reset (new IdentityVertex<float>());
vertex->add_output (sink_a);
vertex->add_output (sink_b);
-
+
ProcessContext<float> c (random_data, frames, 1);
vertex->process (c);
-
+
vertex->clear_outputs ();
ProcessContext<float> zc (zero_data, frames, 1);
vertex->process (zc);
-
+
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink_a->get_array(), frames));
CPPUNIT_ASSERT (TestUtils::array_equals (random_data, sink_b->get_array(), frames));
}
diff --git a/libs/backends/asio/asio_backend.cc b/libs/backends/asio/asio_backend.cc
index 90df11c2c1..60b601665a 100644
--- a/libs/backends/asio/asio_backend.cc
+++ b/libs/backends/asio/asio_backend.cc
@@ -1344,7 +1344,7 @@ ASIOBackend::freewheel_thread ()
pthread_mutex_lock (&_process_callback_mutex);
/* Freewheelin' */
-
+
// clear input buffers
for (std::vector<ASIOBackendPort*>::const_iterator it = _system_inputs.begin (); it != _system_inputs.end (); ++it) {
memset ((*it)->get_buffer (_samples_per_period), 0, _samples_per_period * sizeof (Sample));
diff --git a/libs/backends/coreaudio/coreaudio_backend.cc b/libs/backends/coreaudio/coreaudio_backend.cc
index 36fa3d46a5..1791ffe3a9 100644
--- a/libs/backends/coreaudio/coreaudio_backend.cc
+++ b/libs/backends/coreaudio/coreaudio_backend.cc
@@ -1643,7 +1643,7 @@ CoreAudioBackend::freewheel_thread ()
pthread_mutex_lock (&_process_callback_mutex);
/* Freewheelin' */
-
+
// clear input buffers
for (std::vector<CoreBackendPort*>::const_iterator it = _system_inputs.begin (); it != _system_inputs.end (); ++it) {
memset ((*it)->get_buffer (_samples_per_period), 0, _samples_per_period * sizeof (Sample));
diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc
index 5de12294e1..b414eda563 100644
--- a/libs/backends/jack/jack_audiobackend.cc
+++ b/libs/backends/jack/jack_audiobackend.cc
@@ -126,7 +126,7 @@ JACKAudioBackend::enumerate_devices () const
if (all_devices.find (_target_driver) == all_devices.end()) {
all_devices.insert (make_pair (_target_driver, std::set<string>()));
}
-
+
/* store every device we've found, by driver name.
*
* This is so we do not confuse ALSA, FFADO, netjack etc. devices
@@ -138,7 +138,7 @@ JACKAudioBackend::enumerate_devices () const
for (vector<string>::const_iterator d = currently_available.begin(); d != currently_available.end(); ++d) {
all.insert (*d);
}
-
+
for (DeviceList::const_iterator d = all.begin(); d != all.end(); ++d) {
if (find (currently_available.begin(), currently_available.end(), *d) == currently_available.end()) {
statuses.push_back (DeviceStatus (*d, false));
@@ -146,7 +146,7 @@ JACKAudioBackend::enumerate_devices () const
statuses.push_back (DeviceStatus (*d, false));
}
}
-
+
return statuses;
}
@@ -154,7 +154,7 @@ vector<float>
JACKAudioBackend::available_sample_rates (const string& device) const
{
vector<float> f;
-
+
if (device == _target_device && available()) {
f.push_back (sample_rate());
return f;
@@ -174,7 +174,7 @@ JACKAudioBackend::available_sample_rates (const string& device) const
f.push_back (96000.0);
f.push_back (192000.0);
f.push_back (384000.0);
-
+
return f;
}
@@ -182,7 +182,7 @@ vector<uint32_t>
JACKAudioBackend::available_buffer_sizes (const string& device) const
{
vector<uint32_t> s;
-
+
if (device == _target_device && available()) {
s.push_back (buffer_size());
return s;
@@ -286,7 +286,7 @@ JACKAudioBackend::set_input_channels (uint32_t cnt)
}
_target_input_channels = cnt;
-
+
return 0;
}
@@ -473,7 +473,7 @@ JACKAudioBackend::setup_jack_startup_command (bool for_latency_measurement)
}
options.realtime = true;
options.ports_max = 2048;
-
+
ARDOUR::set_midi_option (options, _target_midi_option);
/* this must always be true for any server instance we start ourselves
@@ -514,14 +514,14 @@ JACKAudioBackend::_start (bool for_latency_measurement)
return -1;
}
}
-
+
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
/* get the buffer size and sample rates established */
jack_sample_rate_callback (jack_get_sample_rate (_priv_jack));
jack_bufsize_callback (jack_get_buffer_size (_priv_jack));
-
+
/* Now that we have buffer size and sample rate established, the engine
can go ahead and do its stuff
*/
@@ -534,9 +534,9 @@ JACKAudioBackend::_start (bool for_latency_measurement)
if (!jack_port_type_get_buffer_size) {
warning << _("This version of JACK is old - you should upgrade to a newer version that supports jack_port_type_get_buffer_size()") << endmsg;
}
-
+
set_jack_callbacks ();
-
+
if (jack_activate (_priv_jack) == 0) {
_running = true;
} else {
@@ -553,7 +553,7 @@ JACKAudioBackend::stop ()
{
_running = false; // no 'engine halted message'.
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
-
+
_jack_connection->close ();
_current_buffer_size = 0;
@@ -571,7 +571,7 @@ JACKAudioBackend::freewheel (bool onoff)
if (onoff == _freewheeling) {
/* already doing what has been asked for */
-
+
return 0;
}
@@ -930,7 +930,7 @@ JACKAudioBackend::process_thread ()
GET_PRIVATE_JACK_POINTER_RET(_priv_jack,0);
pframes_t nframes = jack_cycle_wait (_priv_jack);
-
+
if (engine.process_callback (nframes)) {
return 0;
}
@@ -1050,7 +1050,7 @@ JACKAudioBackend::n_physical (unsigned long flags) const
}
}
}
-
+
jack_free (ports);
}
@@ -1084,9 +1084,9 @@ JACKAudioBackend::control_app_name () const
if (_target_driver.empty() || _target_device.empty()) {
return appname;
}
-
+
if (_target_driver == "ALSA") {
-
+
if (_target_device == "Hammerfall DSP") {
appname = "hdspconf";
} else if (_target_device == "M Audio Delta 1010") {
diff --git a/libs/backends/jack/jack_audiobackend.h b/libs/backends/jack/jack_audiobackend.h
index 7e860df3b8..530e3fdfd7 100644
--- a/libs/backends/jack/jack_audiobackend.h
+++ b/libs/backends/jack/jack_audiobackend.h
@@ -237,7 +237,7 @@ class JACKAudioBackend : public AudioBackend {
JACKAudioBackend* engine;
boost::function<void()> f;
size_t stacksize;
-
+
ThreadData (JACKAudioBackend* e, boost::function<void()> fp, size_t stacksz)
: engine (e) , f (fp) , stacksize (stacksz) {}
};
diff --git a/libs/backends/jack/jack_connection.cc b/libs/backends/jack/jack_connection.cc
index acc32c4400..2747832ec0 100644
--- a/libs/backends/jack/jack_connection.cc
+++ b/libs/backends/jack/jack_connection.cc
@@ -145,7 +145,7 @@ JackConnection::close ()
{
GET_PRIVATE_JACK_POINTER_RET (_jack, -1);
- if (_priv_jack) {
+ if (_priv_jack) {
int ret = jack_client_close (_priv_jack);
_jack = 0;
diff --git a/libs/backends/jack/jack_portengine.cc b/libs/backends/jack/jack_portengine.cc
index 257feb2bf2..10b2efed6b 100644
--- a/libs/backends/jack/jack_portengine.cc
+++ b/libs/backends/jack/jack_portengine.cc
@@ -41,7 +41,7 @@ static uint32_t
ardour_port_flags_to_jack_flags (PortFlags flags)
{
uint32_t jack_flags = 0;
-
+
if (flags & IsInput) {
jack_flags |= JackPortIsInput;
}
@@ -242,7 +242,7 @@ JACKAudioBackend::physically_connected (PortHandle p, bool process_callback_safe
jack_port_t* port = (jack_port_t*) p;
const char** ports;
-
+
if (process_callback_safe) {
ports = jack_port_get_connections ((jack_port_t*)port);
} else {
@@ -328,7 +328,7 @@ JACKAudioBackend::get_ports (const string& port_name_pattern, DataType type, Por
}
jack_free (ports);
-
+
return s.size();
}
@@ -442,7 +442,7 @@ int
JACKAudioBackend::connect (const std::string& src, const std::string& dst)
{
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
-
+
int r = jack_connect (_priv_jack, src.c_str(), dst.c_str());
return r;
}
@@ -505,7 +505,7 @@ void
JACKAudioBackend::set_latency_range (PortHandle port, bool for_playback, LatencyRange r)
{
jack_latency_range_t range;
-
+
range.min = r.min;
range.max = r.max;
@@ -517,7 +517,7 @@ JACKAudioBackend::get_latency_range (PortHandle port, bool for_playback)
{
jack_latency_range_t range;
LatencyRange ret;
-
+
jack_port_get_latency_range ((jack_port_t*) port, for_playback ? JackPlaybackLatency : JackCaptureLatency, &range);
ret.min = range.min;
diff --git a/libs/backends/jack/jack_session.cc b/libs/backends/jack/jack_session.cc
index 8495a5971f..1e9d956876 100644
--- a/libs/backends/jack/jack_session.cc
+++ b/libs/backends/jack/jack_session.cc
@@ -94,7 +94,7 @@ JACKSession::session_event (jack_session_event_t* event)
*/
jack_client_t* jack_client = (jack_client_t*) AudioEngine::instance()->port_engine().private_handle();
-
+
if (jack_client) {
jack_session_reply (jack_client, event);
}
@@ -119,23 +119,23 @@ JACKSession::timebase_callback (jack_transport_state_t /*state*/,
/* BBT info */
TempoMetric metric (tempo_map.metric_at (tf));
-
+
try {
tempo_map.bbt_time_rt (tf, bbt);
-
+
pos->bar = bbt.bars;
pos->beat = bbt.beats;
pos->tick = bbt.ticks;
-
+
// XXX still need to set bar_start_tick
-
+
pos->beats_per_bar = metric.meter().divisions_per_bar();
pos->beat_type = metric.meter().note_divisor();
pos->ticks_per_beat = Timecode::BBT_Time::ticks_per_beat;
pos->beats_per_minute = metric.tempo().beats_per_minute();
-
+
pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
-
+
} catch (...) {
/* no message */
}
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c b/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c
index 511c3c652e..d709ff5c8f 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c
@@ -746,7 +746,7 @@ static void FAR PASCAL winmm_in_callback(
MMRESULT rslt;
lpMidiHdr->dwBytesRecorded = 0;
lpMidiHdr->dwFlags = 0;
-
+
/* note: no error checking -- can this actually fail? */
rslt = midiInPrepareHeader(hMidiIn, lpMidiHdr, sizeof(MIDIHDR));
assert(rslt == MMSYSERR_NOERROR);
diff --git a/libs/backends/wavesaudio/waves_audiobackend.cc b/libs/backends/wavesaudio/waves_audiobackend.cc
index d7467c315e..2c6824e4b2 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.cc
+++ b/libs/backends/wavesaudio/waves_audiobackend.cc
@@ -752,7 +752,7 @@ WavesAudioBackend::_audio_device_callback (const float* input_buffer,
if ( !engine.thread_initialised_for_audio_processing () ) {
std::cerr << "\tWavesAudioBackend::_audio_device_callback (): It's an attempt to call process callback from the thread which didn't initialize it " << std::endl;
-
+
AudioEngine::thread_init_callback (this);
}
@@ -803,7 +803,7 @@ WavesAudioBackend::stop ()
_midi_device_manager.stop ();
_unregister_system_audio_ports ();
_unregister_system_midi_ports ();
-
+
return retVal;
}
diff --git a/libs/backends/wavesaudio/waves_midi_device.cc b/libs/backends/wavesaudio/waves_midi_device.cc
index 47f69da794..e9f0065abf 100644
--- a/libs/backends/wavesaudio/waves_midi_device.cc
+++ b/libs/backends/wavesaudio/waves_midi_device.cc
@@ -47,11 +47,11 @@ WavesMidiDevice::WavesMidiDevice (const std::string& device_name)
{
_pm_input_id = _pm_output_id = pmNoDevice;
int count = Pm_CountDevices ();
-
+
for (int i = 0; i < count; i++) {
-
+
const PmDeviceInfo* pm_device_info = Pm_GetDeviceInfo (i);
-
+
if (pm_device_info == NULL) {
continue;
}
@@ -79,7 +79,7 @@ WavesMidiDevice::open (PmTimeProcPtr time_proc, void* time_info)
if (is_input () ) {
// COMMENTED DBG LOGS */ std::cout << "WavesMidiDevice::open (): INPUT" << _pm_input_id << "-[" << name () << "]" << std::endl;
-
+
if (!_input_pm_stream) {
// create queue
if (!_input_queue) {
@@ -181,7 +181,7 @@ WavesMidiDevice::close ()
_input_queue = NULL;
}
- // output
+ // output
if ( output_pm_stream ) {
// close stream
PmError err = Pm_Close (output_pm_stream);
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h
index cbb3e48e33..571a2341be 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h
@@ -19,7 +19,7 @@
#ifndef __WCFourCC_h__
#define __WCFourCC_h__
-
+
/* Copy to include
#include "BasicTypes/WCFourCC.h"
*/
@@ -206,7 +206,7 @@ inline bool operator!=(const WCFourCC in_left, const WCFourCC in_right)
#define kDefaultFourCC WCFourCC::kDefaultFourCC_prv()
static const WCFourCC kZeroFourCC(0, wvNS::wvBO::compiler_byte_order);
-
+
#endif //#if !defined(__WCFourCC_h__)
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h
index 8b5c73578f..c217fa7a1c 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h
@@ -75,7 +75,7 @@
#endif
namespace wvNS {
-
+
namespace wvBO // namespace Waves::ByteOrder
{
typedef int byte_order_type; // we use int rather than enum because some compilers cannot resolve enum constants at compile-time. There are only two options anyway :-)
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h
index b66f720a34..e8e633d927 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h
@@ -19,7 +19,7 @@
#ifndef __WUComPtr_h__
#define __WUComPtr_h__
-
+
/* Copy to include
#include "BasicTypes/WUComPtr.h"
*/
@@ -36,7 +36,7 @@ typedef int32_t wvComPtr[2];
//================================================================================
inline uint32_t vfpConvertDPtr(const void* InPointer, void* pData)
//================================================================================
-{
+{
uint64_t *pL = (uint64_t *)pData;
*pL = (uint64_t)InPointer;
return (uint32_t)sizeof(uint64_t);
@@ -64,7 +64,7 @@ inline wvComPtr PackToComPtr(const intptr_t in_PtrToPack)
// #ifdef for x32 - intptr_t is 32 bit
// retVal.LSW = int32_t(in_PtrToPack);
// retVal.MSW = 0;
-
+
return retVal;
}
@@ -73,7 +73,7 @@ inline intptr_t UnpackComPtr( const wvComPtr in_ComPtrToUnpack)
// and unpack it to intptr_t type
{
intptr_t retVal;
-
+
// This unpacking is xPlatform coding for x32 and x64
// #ifdef for x64 - intptr_t is 64 bit so use intptr_t instead of int64_t
int64_t PtrAt64 = static_cast<int64_t>(in_ComPtrToUnpack.MSW);
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUMathConsts.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUMathConsts.h
index e918b78c71..6ee16c2ad6 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUMathConsts.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUMathConsts.h
@@ -19,7 +19,7 @@
#ifndef __WUMathConsts_h__
#define __WUMathConsts_h__
-
+
/* Copy to include:
#include "BasicTypes/WUMathConsts.h"
*/
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h
index e1d073db7f..8c6ac71cfc 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h
@@ -84,7 +84,7 @@ public: enum Type
//********************************************************************************
// Files
-//! file (and resource container) opening permissions
+//! file (and resource container) opening permissions
// Note: When opening with eFMWriteOnly on existing file, writing to the file will append, not overwrite, Shai, 9/8/2007.
enum WEPermitions{ eFMReadOnly, eFMWriteOnly, eFMReadWrite};
@@ -133,7 +133,7 @@ enum WESystemFolders{
eWavesPreferencesFolder2, // Mac: "/Users/username/Library/Preferences/Waves Audio"
// Win: "C:\Users\username\AppData\Roaming\Waves Audio\Preferences"
-
+
eNumberOfSystemFolders
};
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h
index d8e31d4f1f..4260f680a5 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h
@@ -40,10 +40,10 @@
template<class T> inline T WUMin(const T &a, const T &b) {return (a < b) ? a : b;} // requires only < to be defined for T
template<class T> inline T WUMax(const T &a,const T &b) {return (a < b) ? b : a;} // requires only < to be defined for T
template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T &Val) // requires only < to be defined for T
-{
+{
return ((Val < Smallest) ? Smallest : ((Biggest < Val) ? Biggest : Val));
}
-/*
+/*
// Min and Max
template<class T> inline T WUMin(T a,T b) {return (a < b) ? a : b;} // requires only < to be defined for T
template<class T> inline T WUMax(T a,T b) {return (a < b) ? b : a;} // requires only < to be defined for T
@@ -51,7 +51,7 @@ template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T
{
return ((X < SMALLEST) ? SMALLEST : ((BIGGEST < X) ? BIGGEST : X));
}
- */
+ */
// Absolute value
#ifdef PLATFORM_WINDOWS
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.cpp b/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.cpp
index fb31d24a78..c51d1910b0 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.cpp
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.cpp
@@ -53,7 +53,7 @@ void UMicrosecondsAccumulator::Start()
void UMicrosecondsAccumulator::Stop()
{
UMicroseconds stop_time;
-
+
m_accumulator += stop_time.GetNativeTime() - m_start_time.GetNativeTime();
}
@@ -73,5 +73,5 @@ UMicrosecondsAccumulator& UMicrosecondsAccumulator::operator+=(const UMicrosecon
m_accumulator += inaccum_to_add.GetAccumulatedTime();
return *this;
}
-
+
} // namespace wvNS {
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h
index 508ff12acb..af1eb8e37f 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h
@@ -19,7 +19,7 @@
#ifndef __UMicroseconds_h__
#define __UMicroseconds_h__
-
+
/* Copy to include
#include "UMicroseconds.h"
*/
@@ -87,15 +87,15 @@ class UMicrosecondsAccumulator
{
public:
UMicrosecondsAccumulator() : m_start_time(0), m_accumulator(0) {}
-
+
void Start();
void Stop();
void Clear();
-
+
UMicroseconds GetAccumulatedTime() const;
-
+
UMicrosecondsAccumulator& operator+=(const UMicrosecondsAccumulator&);
-
+
protected:
UMicroseconds m_start_time;
UMicroseconds m_accumulator;
@@ -119,6 +119,6 @@ inline void MicrosecondDelay(double amt)
now.ReadTime();
} while ((now.MicroSeconds() - than.MicroSeconds()) < amt);
}
-
+
} // namespace wvNS {
#endif //#ifndef __UMicroseconds_h__
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h
index 5d2cc88beb..d127e0116a 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h
@@ -58,7 +58,7 @@ public:
typedef intptr_t spos_t; // signed position, defined to intptr_t because Windows does not have ssize_t
static const pos_t npos = UINTPTR_MAX; // Same as size_max
- WCFixedStringBase(char* const in_begin, const size_t in_MaxFixedStringLength) :
+ WCFixedStringBase(char* const in_begin, const size_t in_MaxFixedStringLength) :
m_begin(in_begin),
m_MaxFixedStringLength(in_MaxFixedStringLength),
m_end(in_begin)
@@ -280,10 +280,10 @@ public:
#endif
#ifdef __APPLE__
std::snprintf(buf, tempBufSize, "%.*f", in_precision, in_double);
- #endif
- #ifdef __linux__
+ #endif
+ #ifdef __linux__
snprintf(buf, tempBufSize, "%.*f", in_precision, in_double);
- #endif
+ #endif
operator<<(buf);
}
@@ -383,17 +383,17 @@ public:
// WCFixedStringBase& operator<<(const unsigned char in_uint) {
// return operator<<(static_cast<const unsigned long long>(in_uint));
// }
-//
+//
// WCFixedStringBase& operator<<(const size_t in_uint) {
// return operator<<(static_cast<const uint64_t>(in_uint));
// }
-//
+//
#if defined(__APPLE__) || defined(PLATFORM_WINDOWS) || defined(__linux__) // both 32 & 64 bit
WCFixedStringBase& operator<<(const unsigned int in_uint) {
return operator<<(static_cast<uint64_t>(in_uint));
}
#endif
-//
+//
#if defined(PLATFORM_WINDOWS) || defined(__linux__) // both 32 & 64 bit
WCFixedStringBase& operator<<(const unsigned long in_uint) {
return operator<<(static_cast<uint64_t>(in_uint));
@@ -473,7 +473,7 @@ public:
ptrdiff_t compare(const WCFixedStringBase& in_to_compare) const
{
- ptrdiff_t retVal = compare(in_to_compare.c_str());
+ ptrdiff_t retVal = compare(in_to_compare.c_str());
return retVal;
}
@@ -496,7 +496,7 @@ public:
ptrdiff_t case_insensitive_compare(const WCFixedStringBase& in_to_compare) const
{
- ptrdiff_t retVal = case_insensitive_compare(in_to_compare.c_str());
+ ptrdiff_t retVal = case_insensitive_compare(in_to_compare.c_str());
return retVal;
}
@@ -690,7 +690,7 @@ public:
bool retVal = (0 == where) || (0 == ::strlen(in_begin_text));
return retVal;
}
-
+
// return true if in_end_text is found at th end OR if in_end_text is empty
bool ends_with(const char* in_end_text) const
{
@@ -775,7 +775,7 @@ public:
}
}
-protected:
+protected:
~WCFixedStringBase() {}
char* const m_begin;
@@ -853,12 +853,12 @@ public:
return retVal;
}
-protected:
+protected:
char m_fixedString[kMaxFixedStringLength + 1]; // the "+ 1" is so that *m_end is always valid, and we can put the '\0' there};
};
-inline bool operator==(const WCFixedStringBase& in_left, const WCFixedStringBase& in_right)
+inline bool operator==(const WCFixedStringBase& in_left, const WCFixedStringBase& in_right)
{
return 0 == in_left.compare(in_right.c_str());
}
@@ -868,7 +868,7 @@ inline bool operator==(const WCFixedStringBase& in_left, const char* const in_ri
return 0 == in_left.compare(in_right);
}
-inline bool operator!=(const WCFixedStringBase& in_left, const WCFixedStringBase& in_right)
+inline bool operator!=(const WCFixedStringBase& in_left, const WCFixedStringBase& in_right)
{
return 0 != in_left.compare(in_right.c_str());
}
@@ -893,11 +893,11 @@ template<size_t kSizeOfFirst, size_t kSizeOfSecond>
class WCFixedStringPair : public std::pair< WCFixedString<kSizeOfFirst>, WCFixedString<kSizeOfSecond> >
{
public:
- WCFixedStringPair(const char* const in_firstStr = 0, const char* const in_secondStr = 0) :
+ WCFixedStringPair(const char* const in_firstStr = 0, const char* const in_secondStr = 0) :
std::pair< WCFixedString<kSizeOfFirst>, WCFixedString<kSizeOfSecond> >(in_firstStr, in_secondStr) {}
- WCFixedStringPair(const WCFixedStringBase& in_firstStr, const char* const in_secondStr = 0) :
+ WCFixedStringPair(const WCFixedStringBase& in_firstStr, const char* const in_secondStr = 0) :
std::pair< WCFixedString<kSizeOfFirst>, WCFixedString<kSizeOfSecond> >(in_firstStr, in_secondStr) {}
- WCFixedStringPair(const WCFixedStringBase& in_firstStr, const WCFixedStringBase& in_secondStr) :
+ WCFixedStringPair(const WCFixedStringBase& in_firstStr, const WCFixedStringBase& in_secondStr) :
std::pair< WCFixedString<kSizeOfFirst>, WCFixedString<kSizeOfSecond> >(in_firstStr, in_secondStr) {}
};
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h
index 294ef0905f..007d32f433 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h
@@ -280,34 +280,34 @@ const WTErr eIPC_ParseArgsFailed = -14207;
const WTErr eIPC_OpenPipeFailed = -14208;
const WTErr eIPC_SendMsgFailed = -14209;
const WTErr eIPC_SendCommandInvalid = -14210;
-const WTErr eIPC_QtTestMode = -14211;
-const WTErr eIPC_ChangePermissionOnPipe = -14212;
-const WTErr eIPC_ConnectionLost = -14213;
+const WTErr eIPC_QtTestMode = -14211;
+const WTErr eIPC_ChangePermissionOnPipe = -14212;
+const WTErr eIPC_ConnectionLost = -14213;
-const WTErr eIPC_InvalidRole = -14213;
+const WTErr eIPC_InvalidRole = -14213;
const WTErr eIPC_CreateNamedPipeM2SFailed = -14214;
const WTErr eIPC_CreateNamedPipeS2MFailed = -14215;
-const WTErr eIPC_ChangePermissionOnPipeM2S = -14216;
-const WTErr eIPC_ChangePermissionOnPipeS2M = -14217;
-const WTErr eIPC_OpenReadPipeFailed = -14218;
-const WTErr eIPC_OpenReadPipeDIsableSigPipe = -14219;
-const WTErr eIPC_OpenWritePipeFailed = -14220;
-const WTErr eIPC_WritePipeFailed = -14221;
-const WTErr eIPC_WritePipeNotOpen = -14222;
-const WTErr eIPC_WriteBufferResizeFailed = -14223;
-const WTErr eIPC_NotConnectedSendMsgFailed = -14224;
-const WTErr eIPC_OpenWritePipeWorkerStoping = -14225;
-const WTErr eIPC_SoketSendFailed = -14226;
-const WTErr eIPC_PtonFailed = -14227;
-const WTErr eIPC_SocketFailed = -14228;
-const WTErr eIPC_BindFailed = -14229;
-const WTErr eIPC_ListenFailed = -14230;
-const WTErr eIPC_ConnectFailed = -14231;
+const WTErr eIPC_ChangePermissionOnPipeM2S = -14216;
+const WTErr eIPC_ChangePermissionOnPipeS2M = -14217;
+const WTErr eIPC_OpenReadPipeFailed = -14218;
+const WTErr eIPC_OpenReadPipeDIsableSigPipe = -14219;
+const WTErr eIPC_OpenWritePipeFailed = -14220;
+const WTErr eIPC_WritePipeFailed = -14221;
+const WTErr eIPC_WritePipeNotOpen = -14222;
+const WTErr eIPC_WriteBufferResizeFailed = -14223;
+const WTErr eIPC_NotConnectedSendMsgFailed = -14224;
+const WTErr eIPC_OpenWritePipeWorkerStoping = -14225;
+const WTErr eIPC_SoketSendFailed = -14226;
+const WTErr eIPC_PtonFailed = -14227;
+const WTErr eIPC_SocketFailed = -14228;
+const WTErr eIPC_BindFailed = -14229;
+const WTErr eIPC_ListenFailed = -14230;
+const WTErr eIPC_ConnectFailed = -14231;
const WTErr eIPC_WsaStartupFailed = -14232;
const WTErr eIPC_UdpSocketCreateFailed = -14233;
const WTErr eIPC_UdpSocketConnectFailed = -14234;
const WTErr eIPC_UdpSocketBinFailed = -14235;
-const WTErr eIPC_SetBufferPreambleFailed = -14226;
+const WTErr eIPC_SetBufferPreambleFailed = -14226;
// Database errors
const WTErr eDB_BatchRollback = -15501;
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/safe_delete.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/safe_delete.h
index 830ac436e8..0537d1591b 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/safe_delete.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/safe_delete.h
@@ -19,7 +19,7 @@
#ifndef __safe_delete_h__
#define __safe_delete_h__
-
+
/* Copy to include:
#include "safe_delete.h"
diff --git a/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h b/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h
index 4a24eab05d..eb8d91c696 100644
--- a/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h
+++ b/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h
@@ -191,7 +191,7 @@ namespace wvThread
void obtain();
bool tryobtain();
void release();
-
+
private:
ThreadMutexInited(const ThreadMutexInited&); // cannot be copied
ThreadMutexInited& operator=(const ThreadMutexInited&); // cannot be copied
@@ -224,7 +224,7 @@ namespace wvThread
public:
ThreadMutex() {init();}
};
-
+
//--------------------------------------------------------
class DllExport ThreadConditionSignal : public noncopyableobject
{
diff --git a/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h b/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h
index 71ef9bfe92..46869c40ae 100644
--- a/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h
+++ b/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h
@@ -33,7 +33,7 @@
#if ! defined(__STDC_LIMIT_MACROS)
#define __STDC_LIMIT_MACROS
#endif
-
+
#include <stddef.h>
#include </usr/include/stdint.h>
#endif
diff --git a/libs/backends/wavesaudio/wavesapi/akupara/basics.hpp b/libs/backends/wavesaudio/wavesapi/akupara/basics.hpp
index 45d29955c7..33808ede8d 100644
--- a/libs/backends/wavesaudio/wavesapi/akupara/basics.hpp
+++ b/libs/backends/wavesaudio/wavesapi/akupara/basics.hpp
@@ -21,7 +21,7 @@ namespace Akupara
null_type(const null_type *) {} // this allows 0 to be implicitly converted to null_type
};
inline null_type null() { return null_type(); }
-
+
// This is a byte, guaranteed to be unsigned regardless of your compiler's char signedness
typedef uint8_t byte_type;
diff --git a/libs/backends/wavesaudio/wavesapi/akupara/compiletime_functions.hpp b/libs/backends/wavesaudio/wavesapi/akupara/compiletime_functions.hpp
index 9c146dcebf..14c5f96523 100644
--- a/libs/backends/wavesaudio/wavesapi/akupara/compiletime_functions.hpp
+++ b/libs/backends/wavesaudio/wavesapi/akupara/compiletime_functions.hpp
@@ -147,7 +147,7 @@ namespace Akupara
AKUPARA_SIGNED_UNSIGNED_INTEGER_PAIR(1, char )
AKUPARA_SIGNED_UNSIGNED_INTEGER_PAIR(2, short )
AKUPARA_SIGNED_UNSIGNED_INTEGER_PAIR(3, int )
-
+
//AKUPARA_SIGNED_UNSIGNED_INTEGER_PAIR(4, int32_t )// 64BitConversion
template<>
struct
diff --git a/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops.hpp b/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops.hpp
index b5010eaff9..2111026d0b 100644
--- a/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops.hpp
+++ b/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops.hpp
@@ -378,7 +378,7 @@ _byte_count :
public:
pad_to_cache_line() {}
template<typename _arg_type> pad_to_cache_line(_arg_type arg) : base_type(arg) {}
- };
+ };
//---------------------------------------------------------------------
} // namespace atomic
diff --git a/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops_gcc_x86.hpp b/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops_gcc_x86.hpp
index 148c297552..74d73106f8 100644
--- a/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops_gcc_x86.hpp
+++ b/libs/backends/wavesaudio/wavesapi/akupara/threading/atomic_ops_gcc_x86.hpp
@@ -19,7 +19,7 @@ namespace Akupara
namespace machine
{
const unsigned int k_bytes_per_cache_line = 64; // this is true for P4 & K8
-
+
// Flags for operations supported by this machine
//-------------------------------------
@@ -30,7 +30,7 @@ namespace Akupara
template<> struct implements_add <4> : public true_type {};
template<> struct implements_fetch_and_add<4> : public true_type {};
//-------------------------------------
-
+
// CAS
@@ -162,10 +162,10 @@ namespace Akupara
return fetch_and_add(operand_address, -subtrahend);
}
//--------------------------------------------------------------------------------
-
-
+
+
// Memory barriers
//--------------------------------------------------------------------------------
inline void memory_barrier_readwrite()
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.cpp
index 481aa2d860..7c4a3e9962 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.cpp
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.cpp
@@ -77,7 +77,7 @@ WCMRAudioDevice::~WCMRAudioDevice ()
const std::string& WCMRAudioDevice::DeviceName () const
{
return (m_DeviceName);
-
+
}
@@ -95,7 +95,7 @@ const std::string& WCMRAudioDevice::DeviceName () const
const std::vector<std::string>& WCMRAudioDevice::InputChannels ()
{
return (m_InputChannels);
-
+
}
@@ -263,7 +263,7 @@ WTErr WCMRAudioDevice::SetCurrentBufferSize (int newSize)
WCMRAudioDevice::ConnectionStates WCMRAudioDevice::ConnectionStatus ()
{
return (m_ConnectionStatus);
-
+
}
@@ -282,7 +282,7 @@ WCMRAudioDevice::ConnectionStates WCMRAudioDevice::ConnectionStatus ()
bool WCMRAudioDevice::Active ()
{
return (m_IsActive);
-
+
}
@@ -344,7 +344,7 @@ WTErr WCMRAudioDevice::SetStreaming (bool newState)
if (newState) {
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::DeviceStartsStreaming);
}
-
+
//This will most likely be overridden, the base class simply
//changes the member.
m_IsStreaming = newState;
@@ -359,7 +359,7 @@ WTErr WCMRAudioDevice::ResetDevice ()
bool wasActive = Active();
WTErr err = SetStreaming(false);
-
+
if (err == eNoErr)
err = SetActive(false);
@@ -461,11 +461,11 @@ void WCMRAudioDevice::GetMonitorInfo (int *pLeftChannel, int *pRightChannel, flo
{
if (pLeftChannel)
*pLeftChannel = m_LeftMonitorChannel;
- if (pRightChannel)
+ if (pRightChannel)
*pRightChannel = m_RightMonitorChannel;
- if (pGain)
+ if (pGain)
*pGain = m_MonitorGain;
- return;
+ return;
}
@@ -688,5 +688,5 @@ void WCMRAudioDeviceManager::NotifyClient (WCMRAudioDeviceManagerClient::Notific
{
if (m_pTheClient)
m_pTheClient->AudioDeviceManagerNotification (forReason, pParam);
- return;
+ return;
}
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
index 4dae8abab6..b22e35263d 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
@@ -166,24 +166,24 @@ public:
virtual bool Active();///<Active status - mainly significant for ASIO, as certain ops can only be performed on active devices!
virtual WTErr SetActive (bool newState);///<Prepare/Activate device.
-
+
virtual bool Streaming();///<Streaming Status?
virtual WTErr SetStreaming (bool newState);///<Start/Stop Streaming - should reconnect connections when streaming starts!
virtual WTErr ResetDevice ();
virtual bool IsProcessActive();
-
+
virtual WTErr DoIdle();///<Do Idle Processing
-
+
virtual const std::vector<float>& InputLevels();///<Retrieve Input Levels (for VU display)?
-
+
virtual const std::vector<float>& OutputLevels();///<Retrieve Output Levels (for VU display)?
void GetMonitorInfo (int *pLeftChannel = NULL, int *pRightChannel = NULL, float *pGain = NULL);///<Retrieve current monitor channel pair and gain - optional, will not be available with AG
virtual WTErr SetMonitorChannels (int leftChannel, int rightChannel);///<Set monitor channels. - optional, will not be available with AG
virtual WTErr SetMonitorGain (float newGain);///<Set monitor gain. - optional, will not be available with AG
-
+
virtual WTErr ShowConfigPanel (void *pParam);///< Show Control Panel - in case of ASIO this will work only with Active device!
virtual WTErr SendCustomCommand (int customCommand, void *pCommandParam); ///< Send a custom command to the audiodevice...
@@ -193,13 +193,13 @@ public:
protected:
WCMRAudioDeviceManager *m_pMyManager; ///< The manager who's managing this device, can be used for sending notifications!
-
+
std::string m_DeviceName; ///< Name of the device.
std::vector<std::string> m_InputChannels; ///< List of input channel names.
std::vector<std::string> m_OutputChannels; ///< List of output channel names.
std::vector<int> m_SamplingRates; ///< List of available sampling rates.
std::vector<int> m_BufferSizes; ///< List of available buffer sizes.
-
+
int m_CurrentSamplingRate; ///< Currently selected sampling rate.
int m_CurrentBufferSize; ///< Currently selected buffer size.
@@ -208,7 +208,7 @@ protected:
bool m_IsStreaming; ///< Flag for streaming status.
std::vector<float> m_InputLevels; ///< List of input levels.
std::vector<float> m_OutputLevels; ///< List of output levels.
-
+
int m_LeftMonitorChannel; ///< The device channel to use for monitoring left channel data.
int m_RightMonitorChannel; ///< The device channel to use for monitoring right channel data.
float m_MonitorGain; ///< Amount of gain to apply for monitoring signal.
@@ -251,7 +251,7 @@ protected:
mutable wvNS::wvThread::ThreadMutex m_AudioDeviceInfoVecMutex; // mutex to lock device info list
DeviceInfoVec m_DeviceInfoVec;
-
+
eAudioDeviceFilter m_eAudioDeviceFilter;
WCMRAudioDevice* m_CurrentDevice;
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
index e630a7d1a9..0d92493b51 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
@@ -81,14 +81,14 @@ public:
virtual WTErr SetStreaming (bool newState);///<Start/Stop Streaming - should reconnect connections when streaming starts!
virtual WTErr DoIdle();///<Do Idle Processing
-
+
virtual WTErr SetMonitorChannels (int leftChannel, int rightChannel);///<Set monitor channels. - optional, will not be available with AG
virtual WTErr SetMonitorGain (float newGain);///<Set monitor gain. - optional, will not be available with AG
-
+
virtual WTErr ShowConfigPanel (void *pParam);///< Show Control Panel - in case of ASIO this will work only with Active device!
virtual int AudioCallback (float *pOutputBuffer, unsigned long framesPerBuffer, int64_t inSampleTime, uint64_t inCycleStartTime);
-
+
AudioDeviceID DeviceID () {return m_DeviceID;}
virtual uint32_t GetLatency (bool isInput); ///< Get latency.
@@ -110,7 +110,7 @@ protected:
// int m_CurrentIOCycle; ///< The location in m_IOCyclesTymesTaken array, where the next cycle's value will go.
// int m_CyclesToAccumulate; ///< The number of cycles to accumulate the values for - maximum for last one second.
// unsigned int m_CyclePeriod; ///< The number of host time units for a cycle period - determined by buffer size and sampling rate
-
+
AudioUnit m_AUHALAudioUnit;///< The AUHAL AudioUnit
@@ -136,7 +136,7 @@ protected:
uint32_t m_ToneDataSamples;
uint32_t m_NextSampleToUse;
#endif //WV_USE_TONE_GEN
-
+
WTErr UpdateDeviceInfo ();
WTErr UpdateDeviceId ();
WTErr UpdateDeviceName();
@@ -157,14 +157,14 @@ protected:
#if WV_USE_TONE_GEN
void SetupToneGenerator ();
#endif //WV_USE_TONE_GEN
-
+
static OSStatus StaticAudioIOProc(void *inRefCon, AudioUnitRenderActionFlags * ioActionFlags,
const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames,
AudioBufferList *ioData);
OSStatus AudioIOProc(AudioUnitRenderActionFlags * ioActionFlags,
const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames,
AudioBufferList *ioData);
-
+
static OSStatus StaticPropertyChangeProc (AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput,
AudioDevicePropertyID inPropertyID, void *inClientData);
void PropertyChangeProc (AudioDevicePropertyID inPropertyID);
@@ -196,7 +196,7 @@ protected:
bool m_UseMultithreading; ///< Flag indicates whether to use multi-threading for audio processing.
bool m_bNoCopyAudioBuffer;
-
+
private:
// helper functions for this class only
WTErr getDeviceAvailableSampleRates(DeviceID deviceId, std::vector<int>& sampleRates);
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp
index 0bce97423c..bf5e4fbb90 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp
@@ -106,7 +106,7 @@ WTErr WCMRNativeAudioNoneDevice::SetCurrentBufferSize (int newSize)
//same size, nothing to do.
if (oldSize == newSize)
return eNoErr;
-
+
//see if this is one of our supported rates...
std::vector<int>::iterator intIter = find(m_BufferSizes.begin(), m_BufferSizes.end(), newSize);
if (intIter == m_BufferSizes.end())
@@ -114,14 +114,14 @@ WTErr WCMRNativeAudioNoneDevice::SetCurrentBufferSize (int newSize)
//Can't change, perhaps use an "invalid param" type of error
return eCommandLineParameter;
}
-
+
if (Streaming())
{
//Can't change, perhaps use an "in use" type of error
return eGenericErr;
}
-
+
return WCMRAudioDevice::SetCurrentBufferSize(newSize);
}
@@ -211,15 +211,15 @@ void WCMRNativeAudioNoneDevice::_SilenceThread()
// VERY ROUGH IMPLEMENTATION:
while(Streaming()) {
-
+
uint64_t cycleEndTimeNanos = audioCallbackData.acdCycleStartTimeNanos + cyclePeriodNanos;
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::AudioCallback, (void *)&audioCallbackData);
-
+
audioCallbackData.acdSampleTime += buffer_size;
-
+
int64_t timeToSleepUsecs = ((int64_t)cycleEndTimeNanos - (int64_t)__get_time_nanos())/1000;
-
+
if (timeToSleepUsecs > 0) {
_usleep (timeToSleepUsecs);
}
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp
index c039b49c0b..8e63887d37 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp
@@ -38,7 +38,7 @@ static const int gAllBufferSizes[] =
{
32, 64, 96, 128, 192, 256, 512, 1024, 2048
};
-
+
///< The default SR.
static const int DEFAULT_SR = 44100;
@@ -50,7 +50,7 @@ static const int NONE_DEVICE_ID = -1;
///< Number of stalls to wait before notifying user...
static const int NUM_STALLS_FOR_NOTIFICATION = 100; // 100 corresponds to 100 x 42 ms idle timer - about 4 seconds.
static const int CHANGE_CHECK_COUNTER_PERIOD = 100; // 120 corresponds to 120 x 42 ms idle timer - about 4 seconds.
-
+
#define HUNDRED_NANO_TO_MILLI_CONSTANT 10000
#define CONSUMPTION_CALCULATION_INTERVAL 500 // Milli Seconds
@@ -165,7 +165,7 @@ void WCMRPortAudioDevice::initDevice()
}
else
std::cout << "API::Device " << m_DeviceName << " Device does not support any sample rate of ours" << std::endl;
-
+
//should use a valid current buffer size
if (m_BufferSizes.size())
{
@@ -177,7 +177,7 @@ void WCMRPortAudioDevice::initDevice()
m_CurrentBufferSize = m_BufferSizes[0];
}
}
-
+
//build our input/output level lists
for (unsigned int currentChannel = 0; currentChannel < m_InputChannels.size(); currentChannel++)
{
@@ -215,7 +215,7 @@ void WCMRPortAudioDevice::terminateDevice()
{
stopStreaming();
}
-
+
//If device is active (meaning stream is open) we need to close it.
if (Active())
{
@@ -285,7 +285,7 @@ WCMRPortAudioDevice::~WCMRPortAudioDevice ()
WTErr WCMRPortAudioDevice::UpdateDeviceInfo ()
{
std::cout << "API::Device (ID:)" << m_DeviceID << " Updating device info" << std::endl;
-
+
SignalObjectAndWait(m_hUpdateDeviceInfoRequestedEvent, m_hUpdateDeviceInfoDone, INFINITE, false);
return eNoErr;
@@ -307,7 +307,7 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
//get device info
const PaDeviceInfo *pDeviceInfo = Pa_GetDeviceInfo(m_DeviceID);
-
+
//update name.
m_DeviceName = pDeviceInfo->name;
@@ -336,7 +336,7 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
////////////////////////////////////////////////////////////////////////////////////
//update list of supported SRs...
m_SamplingRates.clear();
-
+
// now iterate through our standard SRs and check if they are supported by device
// store them for this device
for(int sr=0; gAllSampleRates[sr] > 0; sr++)
@@ -356,11 +356,11 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
// In ASIO Windows, the buffer size is set from the sound device manufacturer's control panel
long minSize, maxSize, preferredSize, granularity;
PaError err = PaAsio_GetAvailableBufferSizes(m_DeviceID, &minSize, &maxSize, &preferredSize, &granularity);
-
+
if (err == paNoError)
{
std::cout << "API::Device " << m_DeviceName << " Buffers: " << minSize << " " << maxSize << " " << preferredSize << std::endl;
-
+
m_BufferSizes.push_back (preferredSize);
useDefaultBuffers = false;
}
@@ -368,7 +368,7 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
{
std::cout << "API::Device" << m_DeviceName << " Preffered buffer size is not supported" << std::endl;
}
-
+
if (useDefaultBuffers)
{
std::cout << "API::Device" << m_DeviceName << " Using default buffer sizes " <<std::endl;
@@ -404,17 +404,17 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
m_InputChannels.push_back (chNameStream.str());
}
-
-
+
+
//Update output channels
m_OutputChannels.clear();
for (int channel = 0; channel < maxOutputChannels; channel++)
{
const char* channelName[32]; // 32 is max leth declared by PortAudio for this operation
std::stringstream chNameStream;
-
+
PaError error = PaAsio_GetOutputChannelName(m_DeviceID, channel, channelName);
-
+
chNameStream << (channel+1) << " - ";
if (error == paNoError)
@@ -425,7 +425,7 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/)
{
chNameStream << "Output " << (channel+1);
}
-
+
m_OutputChannels.push_back (chNameStream.str());
}
}
@@ -467,13 +467,13 @@ PaError WCMRPortAudioDevice::testStateValidness(int sampleRate, int bufferSize)
pOutS = &outputParameters;
PaStream *portAudioStream = NULL;
-
+
//sometimes devices change buffer size if sample rate changes
//it updates buffer size during stream opening
//we need to find out how device would behave with current sample rate
//try opening test stream to load device driver for current sample rate and buffer size
paErr = Pa_OpenStream (&portAudioStream, pInS, pOutS, sampleRate, bufferSize, paDitherOff, NULL, NULL);
-
+
if (portAudioStream)
{
// close test stream
@@ -500,7 +500,7 @@ int WCMRPortAudioDevice::CurrentSamplingRate ()
{
AUTO_FUNC_DEBUG;
//ToDo: Perhaps for ASIO devices that are active, we should retrive the SR from the device...
-
+
return (m_CurrentSamplingRate);
}
@@ -548,7 +548,7 @@ WTErr WCMRPortAudioDevice::SetStreaming (bool newState)
WTErr WCMRPortAudioDevice::ResetDevice()
{
std::cout << "API::Device: " << m_DeviceName << " Reseting device" << std::endl;
-
+
SignalObjectAndWait(m_hResetRequestedEvent, m_hResetDone, INFINITE, false);
if (ConnectionStatus() == DeviceErrors)
@@ -579,7 +579,7 @@ WTErr WCMRPortAudioDevice::SetCurrentSamplingRate (int newRate)
//changes the status.
int oldRate = CurrentSamplingRate();
bool oldActive = Active();
-
+
//no change, nothing to do
if (oldRate == newRate)
return (retVal);
@@ -593,14 +593,14 @@ WTErr WCMRPortAudioDevice::SetCurrentSamplingRate (int newRate)
retVal = eCommandLineParameter;
return (retVal);
}
-
+
if (Streaming())
{
//Can't change, perhaps use an "in use" type of error
retVal = eGenericErr;
return (retVal);
}
-
+
//make the change...
m_CurrentSamplingRate = newRate;
PaError paErr = PaAsio_SetStreamSampleRate (m_PortAudioStream, m_CurrentSamplingRate);
@@ -614,7 +614,7 @@ WTErr WCMRPortAudioDevice::SetCurrentSamplingRate (int newRate)
retVal = eWrongObjectState;
}
-
+
return (retVal);
}
@@ -693,7 +693,7 @@ WCMRPortAudioDevice::ConnectionStates WCMRPortAudioDevice::ConnectionStatus ()
AUTO_FUNC_DEBUG;
//ToDo: May want to do something more to extract the actual status!
return (m_ConnectionStatus);
-
+
}
@@ -710,7 +710,7 @@ void WCMRPortAudioDevice::activateDevice (bool callerIsWaiting/*=false*/)
AUTO_FUNC_DEBUG;
PaError paErr = paNoError;
-
+
// if device is not active activate it
if (!Active() )
{
@@ -748,11 +748,11 @@ void WCMRPortAudioDevice::activateDevice (bool callerIsWaiting/*=false*/)
paDitherOff,
WCMRPortAudioDevice::TheCallback,
this);
-
+
if(paErr != paNoError)
{
std::cout << "Cannot open streamm with buffer: "<< m_CurrentBufferSize << " Error: " << Pa_GetErrorText (paErr) << std::endl;
-
+
if (paErr == paUnanticipatedHostError)
std::cout << "Error details: "<< Pa_GetLastHostErrorInfo ()->errorText << "; code: " << Pa_GetLastHostErrorInfo ()->errorCode << std::endl;
}
@@ -803,7 +803,7 @@ void WCMRPortAudioDevice::activateDevice (bool callerIsWaiting/*=false*/)
m_lastErr = eAsioFailed;
}
-
+
}
std::cout << "Activation is DONE "<< std::endl;
@@ -825,14 +825,14 @@ void WCMRPortAudioDevice::deactivateDevice (bool callerIsWaiting/*=false*/)
AUTO_FUNC_DEBUG;
PaError paErr = paNoError;
-
+
if (Active() )
{
if (Streaming())
{
stopStreaming ();
}
-
+
if (m_PortAudioStream)
{
//close the stream first
@@ -892,13 +892,13 @@ void WCMRPortAudioDevice::startStreaming (bool callerIsWaiting/*=false*/)
m_SampleCounter = 0;
std::cout << "API::Device" << m_DeviceName << " Starting device stream" << std::endl;
-
+
//get device info
const PaDeviceInfo *pDeviceInfo = Pa_GetDeviceInfo(m_DeviceID);
-
+
unsigned int inChannelCount = pDeviceInfo->maxInputChannels;
unsigned int outChannelCount = pDeviceInfo->maxOutputChannels;
-
+
// Prepare for streaming - tell Engine to do the initialization for process callback
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::DeviceStartsStreaming);
@@ -917,7 +917,7 @@ void WCMRPortAudioDevice::startStreaming (bool callerIsWaiting/*=false*/)
m_lastErr = eGenericErr;
}
}
-
+
if (callerIsWaiting)
SetEvent(m_hStartStreamingDone);
}
@@ -995,7 +995,7 @@ void WCMRPortAudioDevice::resetDevice (bool callerIsWaiting /*=false*/ )
// Reinitialize PA
Pa_Terminate();
Pa_Initialize();
-
+
std::cout << "Updating device state... " << std::endl;
// update device info
updateDeviceInfo();
@@ -1145,7 +1145,7 @@ WTErr WCMRPortAudioDevice::DoIdle ()
};
const size_t hEventsSize = sizeof(hEvents)/sizeof(hEvents[0]);
-
+
initDevice();
for(;;)
@@ -1255,7 +1255,7 @@ WTErr WCMRPortAudioDevice::SetMonitorGain (float newGain)
AUTO_FUNC_DEBUG;
//This will most likely be overridden, the base class simply
//changes the member.
-
+
m_MonitorGain = newGain;
return (eNoErr);
}
@@ -1278,7 +1278,7 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam)
{
AUTO_FUNC_DEBUG;
WTErr retVal = eNoErr;
-
+
if (Active() && !m_ResetRequested )
{
#ifdef PLATFORM_WINDOWS
@@ -1291,7 +1291,7 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam)
// show control panel for the device
if (PaAsio_ShowControlPanel (m_DeviceID, pParam) != paNoError)
retVal = eGenericErr;
-
+
// restore previous state for the device
SetActive(true);
if (wasStreaming)
@@ -1305,9 +1305,9 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam)
}
#else
pParam = pParam;
-#endif //_windows
+#endif //_windows
}
-
+
return (retVal);
}
@@ -1336,7 +1336,7 @@ int WCMRPortAudioDevice::TheCallback (const void *pInputBuffer, void *pOutputBuf
(statusFlags & (paInputOverflow | paOutputUnderflow)) != 0);
else
return (true);
-
+
}
@@ -1388,7 +1388,7 @@ int WCMRPortAudioDevice::AudioCallback( const float *pInputBuffer, float *pOutpu
//Don't try to access after this call returns!
m_pInputData = NULL;
- m_SampleCounter += framesPerBuffer;
+ m_SampleCounter += framesPerBuffer;
return m_StopRequested;
}
@@ -1417,7 +1417,7 @@ WCMRPortAudioDeviceManager::WCMRPortAudioDeviceManager (WCMRAudioDeviceManagerCl
{
AUTO_FUNC_DEBUG;
std::cout << "API::PortAudioDeviceManager::PA Device manager constructor" << std::endl;
-
+
//Always create the None device first...
m_NoneDevice = new WCMRNativeAudioNoneDevice(this);
@@ -1443,7 +1443,7 @@ WCMRPortAudioDeviceManager::WCMRPortAudioDeviceManager (WCMRAudioDeviceManagerCl
WCMRPortAudioDeviceManager::~WCMRPortAudioDeviceManager()
{
AUTO_FUNC_DEBUG;
-
+
std::cout << "API::Destroying PortAudioDeviceManager " << std::endl;
try
@@ -1480,7 +1480,7 @@ WCMRAudioDevice* WCMRPortAudioDeviceManager::initNewCurrentDeviceImpl(const std:
{
std::cout << "API::PortAudioDeviceManager::Creating PA device: " << devInfo.m_DeviceId << ", Device Name: " << devInfo.m_DeviceName << std::endl;
TRACE_MSG ("API::PortAudioDeviceManager::Creating PA device: " << devInfo.m_DeviceId << ", Device Name: " << devInfo.m_DeviceName);
-
+
m_CurrentDevice = new WCMRPortAudioDevice (this, devInfo.m_DeviceId, m_UseMultithreading, m_bNoCopyAudioBuffer);
}
catch (...)
@@ -1548,7 +1548,7 @@ WTErr WCMRPortAudioDeviceManager::getDeviceAvailableSampleRates(DeviceID deviceI
WTErr WCMRPortAudioDeviceManager::getDeviceAvailableBufferSizes(DeviceID deviceId, std::vector<int>& buffers)
{
WTErr retVal = eNoErr;
-
+
buffers.clear();
//make PA request to get actual device buffer sizes
@@ -1574,7 +1574,7 @@ WTErr WCMRPortAudioDeviceManager::getDeviceAvailableBufferSizes(DeviceID deviceI
WTErr WCMRPortAudioDeviceManager::generateDeviceListImpl()
{
std::cout << "API::PortAudioDeviceManager::Generating device list" << std::endl;
-
+
WTErr retVal = eNoErr;
//Initialize PortAudio and ASIO first
@@ -1605,7 +1605,7 @@ WTErr WCMRPortAudioDeviceManager::generateDeviceListImpl()
{
//if it's of the required type...
const PaDeviceInfo *pPaDeviceInfo = Pa_GetDeviceInfo(thisDeviceID);
-
+
if (Pa_GetHostApiInfo(pPaDeviceInfo->hostApi)->type == paASIO)
{
//build a device object...
@@ -1749,7 +1749,7 @@ WTErr WCMRPortAudioDeviceManager::getDeviceSampleRatesImpl(const std::string & d
WTErr WCMRPortAudioDeviceManager::getDeviceBufferSizesImpl(const std::string & deviceName, std::vector<int>& buffers) const
{
WTErr retVal = eNoErr;
-
+
buffers.clear();
//first check if the request has been made for None device
@@ -1758,7 +1758,7 @@ WTErr WCMRPortAudioDeviceManager::getDeviceBufferSizesImpl(const std::string & d
buffers=m_NoneDevice->BufferSizes();
return retVal;
}
-
+
if (m_CurrentDevice && deviceName == m_CurrentDevice->DeviceName() )
{
buffers=m_CurrentDevice->BufferSizes();
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h
index 7579bfd2ff..c028d09511 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h
@@ -53,12 +53,12 @@ public:
virtual ConnectionStates ConnectionStatus();///< Connection Status - device available, gone, disconnected
virtual WTErr SetActive (bool newState);///<Prepare/Activate device.
-
+
virtual WTErr SetStreaming (bool newState);///<Start/Stop Streaming - should reconnect connections when streaming starts!
virtual WTErr SetMonitorChannels (int leftChannel, int rightChannel);///<Set monitor channels. - optional, will not be available with AG
virtual WTErr SetMonitorGain (float newGain);///<Set monitor gain. - optional, will not be available with AG
-
+
virtual WTErr ShowConfigPanel (void *pParam);///< Show Control Panel - in case of ASIO this will work only with Active device!
virtual int AudioCallback (const float *pInputBuffer, float *pOutputBuffer, unsigned long framesPerBuffe, bool dropsDetectedr);
@@ -71,7 +71,7 @@ public:
static long StaticASIOMessageHook (void *pRefCon, long selector, long value, void* message, double* opt);
long ASIOMessageHook (long selector, long value, void* message, double* opt);
#endif //PLATFORM_WINDOWS
-
+
protected:
static DWORD WINAPI __DoIdle__(LPVOID lpThreadParameter);
@@ -88,7 +88,7 @@ protected:
PaError testStateValidness(int sampleRate, int bufferSize);
///////////////////////////////////////////////////////////
-
+
static int TheCallback (const void *pInputBuffer, void *pOutputBuffer, unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* /*pTimeInfo*/, PaStreamCallbackFlags /*statusFlags*/, void *pUserData );
@@ -154,7 +154,7 @@ class WCMRPortAudioDeviceManager : public WCMRAudioDeviceManager
public:
WCMRPortAudioDeviceManager(WCMRAudioDeviceManagerClient *pTheClient, eAudioDeviceFilter eCurAudioDeviceFilter,
bool useMultithreading = true, bool bNocopy = false); ///< constructor
-
+
virtual ~WCMRPortAudioDeviceManager(void); ///< destructor
protected:
diff --git a/libs/canvas/arc.cc b/libs/canvas/arc.cc
index 8b462414f8..49b3f63f0a 100644
--- a/libs/canvas/arc.cc
+++ b/libs/canvas/arc.cc
@@ -55,7 +55,7 @@ Arc::compute_bounding_box () const
/* this could be smaller in the case of small _arc values
but I can't be bothered to optimize it.
*/
-
+
bbox.x0 = _center.x - _radius;
bbox.y0 = _center.y - _radius;
bbox.x1 = _center.x + _radius;
@@ -73,7 +73,7 @@ Arc::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) const
if (_radius <= 0.0 || _arc_degrees <= 0.0) {
return;
}
-
+
Duple c = item_to_window (Duple (_center.x, _center.y));
context->arc (c.x, c.y, _radius, _start_degrees * (M_PI/180.0), _arc_degrees * (M_PI/180.0));
@@ -98,35 +98,35 @@ void
Arc::set_radius (Coord r)
{
begin_change ();
-
+
_radius = r;
_bounding_box_dirty = true;
end_change ();
-}
+}
void
Arc::set_arc (double deg)
{
begin_change ();
-
+
_arc_degrees = deg;
_bounding_box_dirty = true;
end_change ();
-}
+}
void
Arc::set_start (double deg)
{
begin_change ();
-
+
_start_degrees = deg;
-
+
_bounding_box_dirty = true;
end_change ();
-}
+}
bool
Arc::covers (Duple const & point) const
@@ -135,7 +135,7 @@ Arc::covers (Duple const & point) const
double angle_degs = atan (p.y/p.x) * 2.0 * M_PI;
double radius = sqrt (p.x * p.x + p.y * p.y);
-
+
return (angle_degs >= _start_degrees) &&
(angle_degs <= (_start_degrees + _arc_degrees)) &&
(radius < _radius);
diff --git a/libs/canvas/arrow.cc b/libs/canvas/arrow.cc
index d78b04ef58..1f8f5b44ec 100644
--- a/libs/canvas/arrow.cc
+++ b/libs/canvas/arrow.cc
@@ -58,7 +58,7 @@ Arrow::setup ()
setup_polygon (i);
CANVAS_DEBUG_NAME (_heads[i].polygon, string_compose ("arrow head %1", i));
}
-
+
_line = new Line (this);
CANVAS_DEBUG_NAME (_line, "arrow line");
}
@@ -90,9 +90,9 @@ void
Arrow::set_show_head (int which, bool show)
{
assert (which == 0 || which == 1);
-
+
begin_change ();
-
+
if (!show) {
delete _heads[which].polygon;
_heads[which].polygon = 0;
@@ -114,7 +114,7 @@ void
Arrow::set_head_outward (int which, bool outward)
{
assert (which == 0 || which == 1);
-
+
begin_change ();
_heads[which].outward = outward;
@@ -132,9 +132,9 @@ void
Arrow::set_head_height (int which, Distance height)
{
assert (which == 0 || which == 1);
-
+
begin_change ();
-
+
_heads[which].height = height;
setup_polygon (which);
@@ -150,9 +150,9 @@ void
Arrow::set_head_width (int which, Distance width)
{
assert (which == 0 || which == 1);
-
+
begin_change ();
-
+
_heads[which].width = width;
setup_polygon (which);
@@ -239,7 +239,7 @@ void
Arrow::setup_polygon (int which)
{
assert (which == 0 || which == 1);
-
+
Points points;
if ((which == 0 && _heads[which].outward) || (which == 1 && !_heads[which].outward)) {
diff --git a/libs/canvas/benchmark/benchmark.h b/libs/canvas/benchmark/benchmark.h
index df6fd0ea89..86ed6653c1 100644
--- a/libs/canvas/benchmark/benchmark.h
+++ b/libs/canvas/benchmark/benchmark.h
@@ -16,7 +16,7 @@ public:
void set_iterations (int);
double run ();
-
+
virtual void do_run (ArdourCanvas::ImageCanvas &) = 0;
virtual void finish (ArdourCanvas::ImageCanvas &) {}
diff --git a/libs/canvas/benchmark/items_at_point.cc b/libs/canvas/benchmark/items_at_point.cc
index db0c5343b2..268447ed69 100644
--- a/libs/canvas/benchmark/items_at_point.cc
+++ b/libs/canvas/benchmark/items_at_point.cc
@@ -12,7 +12,7 @@ static void
test (int items_per_cell)
{
Group::default_items_per_cell = items_per_cell;
-
+
int const n_rectangles = 10000;
int const n_tests = 1000;
double const rough_size = 1000;
@@ -42,7 +42,7 @@ int main ()
for (unsigned int i = 0; i < sizeof (tests) / sizeof (int); ++i) {
timeval start;
timeval stop;
-
+
gettimeofday (&start, 0);
test (tests[i]);
gettimeofday (&stop, 0);
@@ -59,4 +59,4 @@ int main ()
cout << "Test " << tests[i] << ": " << seconds << "\n";
}
}
-
+
diff --git a/libs/canvas/benchmark/render_from_log.cc b/libs/canvas/benchmark/render_from_log.cc
index cd064d3e33..0a2af8b7bc 100644
--- a/libs/canvas/benchmark/render_from_log.cc
+++ b/libs/canvas/benchmark/render_from_log.cc
@@ -20,14 +20,14 @@ public:
{
_items_per_cell = items;
}
-
+
void do_run (ImageCanvas& canvas)
{
Group::default_items_per_cell = _items_per_cell;
canvas.set_log_renders (false);
list<Rect> const & renders = canvas.renders ();
-
+
for (list<Rect>::const_iterator i = renders.begin(); i != renders.end(); ++i) {
canvas.render_to_image (*i);
}
@@ -59,4 +59,4 @@ int main (int argc, char* argv[])
return 0;
}
-
+
diff --git a/libs/canvas/benchmark/render_parts.cc b/libs/canvas/benchmark/render_parts.cc
index 14988ab5c6..f5444817ca 100644
--- a/libs/canvas/benchmark/render_parts.cc
+++ b/libs/canvas/benchmark/render_parts.cc
@@ -20,11 +20,11 @@ public:
{
_items_per_cell = items;
}
-
+
void do_run (ImageCanvas& canvas)
{
Group::default_items_per_cell = _items_per_cell;
-
+
for (int i = 0; i < 1e4; i += 50) {
canvas.render_to_image (Rect (i, 0, i + 50, 1024));
}
@@ -55,4 +55,4 @@ int main (int argc, char* argv[])
return 0;
}
-
+
diff --git a/libs/canvas/benchmark/render_whole.cc b/libs/canvas/benchmark/render_whole.cc
index 7f5b348e62..cf4749c3e0 100644
--- a/libs/canvas/benchmark/render_whole.cc
+++ b/libs/canvas/benchmark/render_whole.cc
@@ -39,8 +39,8 @@ int main (int argc, char* argv[])
if (argc > 2) {
render_whole.set_iterations (atoi (argv[2]));
}
-
+
cout << render_whole.run () << "\n";
-
+
return 0;
}
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc
index 2d88eef5ce..c6c4aed20c 100644
--- a/libs/canvas/canvas.cc
+++ b/libs/canvas/canvas.cc
@@ -104,7 +104,7 @@ Canvas::render (Rect const & area, Cairo::RefPtr<Cairo::Context> const & context
#endif
render_count = 0;
-
+
boost::optional<Rect> root_bbox = _root.bounding_box();
if (!root_bbox) {
/* the root has no bounding box, so there's nothing to render */
@@ -113,7 +113,7 @@ Canvas::render (Rect const & area, Cairo::RefPtr<Cairo::Context> const & context
boost::optional<Rect> draw = root_bbox->intersection (area);
if (draw) {
-
+
/* there's a common area between the root and the requested
area, so render it.
*/
@@ -171,7 +171,7 @@ Canvas::dump (ostream& o) const
{
dump_depth = 0;
_root.dump (o);
-}
+}
/** Called when an item has been shown or hidden.
* @param item Item that has been shown or hidden.
@@ -210,7 +210,7 @@ Canvas::item_visual_property_changed (Item* item)
void
Canvas::item_changed (Item* item, boost::optional<Rect> pre_change_bounding_box)
{
-
+
Rect window_bbox = visible_area ();
if (pre_change_bounding_box) {
@@ -223,7 +223,7 @@ Canvas::item_changed (Item* item, boost::optional<Rect> pre_change_bounding_box)
boost::optional<Rect> post_change_bounding_box = item->bounding_box ();
if (post_change_bounding_box) {
-
+
if (item->item_to_window (*post_change_bounding_box).intersection (window_bbox)) {
/* request a redraw of the item's new bounding box */
queue_draw_item_area (item, post_change_bounding_box.get ());
@@ -406,7 +406,7 @@ GtkCanvas::pick_current_item (int state)
* added or removed, so we have no coordinates to work from as is the
* case with a motion event. Find out where the mouse is and use that.
*/
-
+
Glib::RefPtr<const Gdk::Window> pointer_window = Gdk::Display::get_default()->get_window_at_pointer (x, y);
if (pointer_window != get_window()) {
@@ -453,7 +453,7 @@ GtkCanvas::pick_current_item (Duple const & point, int state)
top, but we're going to reverse that for within_items so that its
first item is the upper-most item that can be chosen as _current_item.
*/
-
+
vector<Item const *>::const_iterator i;
list<Item const *> within_items;
@@ -483,7 +483,7 @@ GtkCanvas::pick_current_item (Duple const & point, int state)
DEBUG_TRACE (PBD::DEBUG::CanvasEnterLeave, string_compose ("CURRENT ITEM %1/%2\n", _new_current_item->whatami(), _current_item->name));
return;
}
-
+
_new_current_item = const_cast<Item*> (within_items.front());
}
@@ -525,7 +525,7 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state)
/* Events delivered to canvas items are expected to be in canvas
* coordinates but @param point is in window coordinates.
*/
-
+
Duple c = window_to_canvas (point);
enter_event.x = c.x;
enter_event.y = c.y;
@@ -574,7 +574,7 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state)
* Deliver "virtual" leave notifications to all items in the
* heirarchy between current and new_current.
*/
-
+
for (i = _current_item->parent(); i && i != _new_current_item; i = i->parent()) {
items_to_leave_virtual.push_back (i);
}
@@ -620,7 +620,7 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state)
enter_detail = GDK_NOTIFY_NONLINEAR;
leave_detail = GDK_NOTIFY_NONLINEAR;
}
-
+
if (_current_item && !_current_item->ignore_events ()) {
leave_event.detail = leave_detail;
@@ -685,7 +685,7 @@ GtkCanvas::deliver_event (GdkEvent* event)
/* run through the items from child to parent, until one claims the event */
Item* item = const_cast<Item*> (event_item);
-
+
while (item) {
Item* parent = item->parent ();
@@ -697,10 +697,10 @@ GtkCanvas::deliver_event (GdkEvent* event)
PBD::DEBUG::CanvasEvents,
string_compose ("canvas event handled by %1 %2\n", item->whatami(), item->name.empty() ? "[unknown]" : item->name)
);
-
+
return true;
}
-
+
DEBUG_TRACE (PBD::DEBUG::CanvasEvents, string_compose ("canvas event %3 left unhandled by %1 %2\n", item->whatami(), item->name.empty() ? "[unknown]" : item->name, event_type_string (event->type)));
if ((item = parent) == 0) {
@@ -722,7 +722,7 @@ GtkCanvas::item_going_away (Item* item, boost::optional<Rect> bounding_box)
if (bounding_box) {
queue_draw_item_area (item, bounding_box.get ());
}
-
+
if (_new_current_item == item) {
_new_current_item = 0;
}
@@ -751,7 +751,7 @@ GtkCanvas::item_going_away (Item* item, boost::optional<Rect> bounding_box)
_current_item = 0;
pick_current_item (0); // no mouse state
}
-
+
}
void
@@ -810,13 +810,13 @@ GtkCanvas::on_expose_event (GdkEventExpose* ev)
/* render canvas */
if ( _single_exposure ) {
-
+
render (Rect (ev->area.x, ev->area.y, ev->area.x + ev->area.width, ev->area.y + ev->area.height), draw_context);
} else {
GdkRectangle* rects;
gint nrects;
-
+
gdk_region_get_rectangles (ev->region, &rects, &nrects);
for (gint n = 0; n < nrects; ++n) {
draw_context->set_identity_matrix(); //reset the cairo matrix, just in case someone left it transformed after drawing ( cough )
@@ -824,7 +824,7 @@ GtkCanvas::on_expose_event (GdkEventExpose* ev)
}
g_free (rects);
}
-
+
#ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
if (getenv("ARDOUR_IMAGE_SURFACE")) {
#endif
@@ -856,12 +856,12 @@ GtkCanvas::on_scroll_event (GdkEventScroll* ev)
GdkEvent copy = *((GdkEvent*)ev);
Duple winpos = Duple (ev->x, ev->y);
Duple where = window_to_canvas (winpos);
-
+
pick_current_item (winpos, ev->state);
copy.button.x = where.x;
copy.button.y = where.y;
-
+
/* Coordinates in the event will be canvas coordinates, correctly adjusted
for scroll if this GtkCanvas is in a GtkCanvasViewport.
*/
@@ -904,12 +904,12 @@ GtkCanvas::on_button_press_event (GdkEventButton* ev)
GdkEvent copy = *((GdkEvent*)ev);
Duple winpos = Duple (ev->x, ev->y);
Duple where = window_to_canvas (winpos);
-
+
pick_current_item (winpos, ev->state);
copy.button.x = where.x;
copy.button.y = where.y;
-
+
/* Coordinates in the event will be canvas coordinates, correctly adjusted
for scroll if this GtkCanvas is in a GtkCanvasViewport.
*/
@@ -924,13 +924,13 @@ GtkCanvas::on_button_press_event (GdkEventButton* ev)
*/
bool
GtkCanvas::on_button_release_event (GdkEventButton* ev)
-{
+{
/* translate event coordinates from window to canvas */
GdkEvent copy = *((GdkEvent*)ev);
Duple winpos = Duple (ev->x, ev->y);
Duple where = window_to_canvas (winpos);
-
+
pick_current_item (winpos, ev->state);
copy.button.x = where.x;
@@ -1200,12 +1200,12 @@ GtkCanvas::show_tooltip ()
(void) toplevel->get_window()->get_pointer (pointer_x, pointer_y, mask);
Duple tooltip_window_origin (pointer_x, pointer_y);
-
+
/* convert to root window coordinates */
int win_x, win_y;
dynamic_cast<Gtk::Window*>(toplevel)->get_position (win_x, win_y);
-
+
tooltip_window_origin = tooltip_window_origin.translate (Duple (win_x, win_y));
/* we don't want the pointer to be inside the window when it is
@@ -1227,7 +1227,7 @@ GtkCanvas::show_tooltip ()
/* ready to show */
tooltip_window->present ();
-
+
/* called from a timeout handler, don't call it again */
return false;
diff --git a/libs/canvas/canvas/arc.h b/libs/canvas/canvas/arc.h
index 95bd157cbf..76342c3985 100644
--- a/libs/canvas/canvas/arc.h
+++ b/libs/canvas/canvas/arc.h
@@ -63,7 +63,7 @@ private:
double _arc_degrees;
double _start_degrees;
};
-
+
}
#endif
diff --git a/libs/canvas/canvas/arrow.h b/libs/canvas/canvas/arrow.h
index 6617e13bd2..ba74fa90e7 100644
--- a/libs/canvas/canvas/arrow.h
+++ b/libs/canvas/canvas/arrow.h
@@ -44,7 +44,7 @@ class Polygon;
* @todo Draws vertical lines only; could be generalised
* to draw lines at any angle.
*/
-
+
class LIBCANVAS_API Arrow : public Container
{
public:
@@ -66,7 +66,7 @@ public:
void set_x (Coord);
void set_y0 (Coord);
void set_y1 (Coord);
-
+
bool covers (Duple const &) const;
private:
diff --git a/libs/canvas/canvas/canvas.h b/libs/canvas/canvas/canvas.h
index c812f8a869..87e580e046 100644
--- a/libs/canvas/canvas/canvas.h
+++ b/libs/canvas/canvas/canvas.h
@@ -59,7 +59,7 @@ class ScrollGroup;
* of screen pixels, with an origin of (0, 0) at the top left. x increases
* rightwards and y increases downwards.
*/
-
+
class LIBCANVAS_API Canvas
{
public:
@@ -153,7 +153,7 @@ public:
/** Set the timeout used to display tooltips, in milliseconds
*/
static void set_tooltip_timeout (uint32_t msecs);
-
+
protected:
Root _root;
Color _bg_color;
@@ -205,7 +205,7 @@ protected:
bool on_motion_notify_event (GdkEventMotion *);
bool on_enter_notify_event (GdkEventCrossing*);
bool on_leave_notify_event (GdkEventCrossing*);
-
+
bool button_handler (GdkEventButton *);
bool motion_notify_handler (GdkEventMotion *);
bool deliver_event (GdkEvent *);
@@ -228,7 +228,7 @@ private:
Item * _grabbed_item;
/** the item that currently has key focus or 0 */
Item * _focused_item;
-
+
bool _single_exposure;
sigc::connection tooltip_timeout_connection;
diff --git a/libs/canvas/canvas/circle.h b/libs/canvas/canvas/circle.h
index c84e3aceec..64ce2ea62d 100644
--- a/libs/canvas/canvas/circle.h
+++ b/libs/canvas/canvas/circle.h
@@ -31,7 +31,7 @@ class LIBCANVAS_API Circle : public Arc
Circle (Canvas*);
Circle (Item*);
};
-
+
}
#endif
diff --git a/libs/canvas/canvas/colors.h b/libs/canvas/canvas/colors.h
index 331010e639..2a3cbb2060 100644
--- a/libs/canvas/canvas/colors.h
+++ b/libs/canvas/canvas/colors.h
@@ -59,11 +59,11 @@ class LIBCANVAS_API SVAModifier
double s() const { return _s; }
double v() const { return _v; }
double a() const { return _a; }
-
+
HSV operator () (HSV& hsv) const;
std::string to_string () const;
void from_string (std::string const &);
-
+
private:
Type type;
double _s;
@@ -77,7 +77,7 @@ struct LIBCANVAS_API HSV
HSV (double h, double s, double v, double a = 1.0);
HSV (Color);
HSV (const std::string&);
-
+
double h;
double s;
double v;
@@ -85,12 +85,12 @@ struct LIBCANVAS_API HSV
std::string to_string() const;
bool is_gray() const;
-
+
Color color() const { return hsva_to_color (h,s, v, a); }
operator Color() const { return color(); }
HSV mod (SVAModifier const & svam);
-
+
HSV operator+ (const HSV&) const;
HSV operator- (const HSV&) const;
diff --git a/libs/canvas/canvas/fill.h b/libs/canvas/canvas/fill.h
index 9eddeec6b6..42160a6190 100644
--- a/libs/canvas/canvas/fill.h
+++ b/libs/canvas/canvas/fill.h
@@ -50,7 +50,7 @@ public:
}
typedef std::vector<std::pair<double,Color> > StopList;
-
+
void set_gradient (StopList const & stops, bool is_vertical);
void set_pattern (Cairo::RefPtr<Cairo::Pattern>);
diff --git a/libs/canvas/canvas/flag.h b/libs/canvas/canvas/flag.h
index 82f257b7d2..ed7bc7cacb 100644
--- a/libs/canvas/canvas/flag.h
+++ b/libs/canvas/canvas/flag.h
@@ -41,7 +41,7 @@ public:
void set_font_description (Pango::FontDescription);
bool covers (Duple const &) const;
-
+
private:
void setup (Distance height, Duple position);
@@ -52,5 +52,5 @@ private:
Rectangle* _rectangle;
bool _invert;
};
-
+
}
diff --git a/libs/canvas/canvas/item.h b/libs/canvas/canvas/item.h
index 098816cd4a..e92fc7fb4b 100644
--- a/libs/canvas/canvas/item.h
+++ b/libs/canvas/canvas/item.h
@@ -36,7 +36,7 @@
namespace ArdourCanvas
{
-struct Rect;
+struct Rect;
class Canvas;
class ScrollGroup;
@@ -51,7 +51,7 @@ class ScrollGroup;
* Any item that is being displayed on a canvas has a pointer to that canvas,
* and all except the `root group' have a pointer to their parent group.
*/
-
+
class LIBCANVAS_API Item : public Fill, public Outline
{
public:
@@ -97,7 +97,7 @@ public:
void grab ();
void ungrab ();
-
+
void unparent ();
void reparent (Item *);
@@ -176,7 +176,7 @@ public:
}
bool visible () const;
-
+
/** @return Our canvas, or 0 if we are not attached to one */
Canvas* canvas () const {
return _canvas;
@@ -204,7 +204,7 @@ public:
static int default_items_per_cell;
-
+
/* This is a sigc++ signal because it is solely
concerned with GUI stuff and is thus single-threaded
*/
@@ -223,23 +223,23 @@ public:
return false;
}
};
-
+
sigc::signal1<bool, GdkEvent*, EventAccumulator<bool> > Event;
#ifdef CANVAS_DEBUG
std::string name;
#endif
-
+
#ifdef CANVAS_COMPATIBILITY
void grab_focus ();
-#endif
+#endif
const std::string& tooltip () const { return _tooltip; }
void set_tooltip (const std::string&);
void start_tooltip_timeout ();
void stop_tooltip_timeout ();
-
+
virtual void dump (std::ostream&) const;
std::string whatami() const;
diff --git a/libs/canvas/canvas/line.h b/libs/canvas/canvas/line.h
index b178554c84..bd58887604 100644
--- a/libs/canvas/canvas/line.h
+++ b/libs/canvas/canvas/line.h
@@ -60,7 +60,7 @@ class LIBCANVAS_API Line : public Item
private:
Duple _points[2];
};
-
+
}
#endif
diff --git a/libs/canvas/canvas/line_set.h b/libs/canvas/canvas/line_set.h
index fad100fdf9..c305cceab5 100644
--- a/libs/canvas/canvas/line_set.h
+++ b/libs/canvas/canvas/line_set.h
@@ -51,7 +51,7 @@ public:
struct Line {
Line (Coord p, Distance width_, Color color_) : pos (p), width (width_), color (color_) {}
-
+
Coord pos;
Distance width;
Color color;
diff --git a/libs/canvas/canvas/lookup_table.h b/libs/canvas/canvas/lookup_table.h
index cf52633524..2877f7a727 100644
--- a/libs/canvas/canvas/lookup_table.h
+++ b/libs/canvas/canvas/lookup_table.h
@@ -43,7 +43,7 @@ public:
virtual bool has_item_at_point (Duple const & point) const = 0;
protected:
-
+
Item const & _item;
};
diff --git a/libs/canvas/canvas/outline.h b/libs/canvas/canvas/outline.h
index 474501c8c7..38f8eb2e32 100644
--- a/libs/canvas/canvas/outline.h
+++ b/libs/canvas/canvas/outline.h
@@ -46,7 +46,7 @@ public:
Distance outline_width () const {
return _outline_width;
}
-
+
virtual void set_outline_width (Distance);
bool outline () const {
diff --git a/libs/canvas/canvas/poly_item.h b/libs/canvas/canvas/poly_item.h
index 732adb14b3..bdb7c20b1a 100644
--- a/libs/canvas/canvas/poly_item.h
+++ b/libs/canvas/canvas/poly_item.h
@@ -45,7 +45,7 @@ protected:
Points _points;
};
-
+
}
#endif
diff --git a/libs/canvas/canvas/poly_line.h b/libs/canvas/canvas/poly_line.h
index 04b05f5df1..fce013dfd6 100644
--- a/libs/canvas/canvas/poly_line.h
+++ b/libs/canvas/canvas/poly_line.h
@@ -31,11 +31,11 @@ class LIBCANVAS_API PolyLine : public PolyItem
public:
PolyLine (Canvas*);
PolyLine (Item*);
-
+
void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
virtual void set_steps (Points const &, bool stepped);
-
+
bool covers (Duple const &) const;
/**
* Set the distance at which a point will be considered to be covered
@@ -47,7 +47,7 @@ class LIBCANVAS_API PolyLine : public PolyItem
private:
double _threshold;
};
-
+
}
#endif
diff --git a/libs/canvas/canvas/polygon.h b/libs/canvas/canvas/polygon.h
index e0e6b1a1f7..65fcdde981 100644
--- a/libs/canvas/canvas/polygon.h
+++ b/libs/canvas/canvas/polygon.h
@@ -45,7 +45,7 @@ public:
void cache_shape_computation () const;
};
-
+
}
#endif
diff --git a/libs/canvas/canvas/rectangle.h b/libs/canvas/canvas/rectangle.h
index c40d3fccb0..8b65940454 100644
--- a/libs/canvas/canvas/rectangle.h
+++ b/libs/canvas/canvas/rectangle.h
@@ -34,7 +34,7 @@ public:
Rectangle (Canvas*, Rect const &);
Rectangle (Item*);
Rectangle (Item*, Rect const &);
-
+
void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
void compute_bounding_box () const;
diff --git a/libs/canvas/canvas/root_group.h b/libs/canvas/canvas/root_group.h
index 1763fc11df..1d2c516b8b 100644
--- a/libs/canvas/canvas/root_group.h
+++ b/libs/canvas/canvas/root_group.h
@@ -29,7 +29,7 @@ class LIBCANVAS_API Root : public Container
{
private:
friend class Canvas;
-
+
Root (Canvas *);
void compute_bounding_box () const;
diff --git a/libs/canvas/canvas/ruler.h b/libs/canvas/canvas/ruler.h
index 0a6a13e078..0a2e43587e 100644
--- a/libs/canvas/canvas/ruler.h
+++ b/libs/canvas/canvas/ruler.h
@@ -28,7 +28,7 @@
namespace ArdourCanvas
{
-
+
class LIBCANVAS_API Ruler : public Rectangle
{
public:
@@ -42,7 +42,7 @@ public:
double position;
Style style;
};
-
+
struct Metric {
Metric () : units_per_pixel (0) {}
virtual ~Metric() {}
@@ -51,15 +51,15 @@ public:
/* lower and upper and sample positions, which are also canvas coordinates
*/
-
+
virtual void get_marks (std::vector<Mark>&, double lower, double upper, int maxchars) const = 0;
};
-
+
Ruler (Canvas*, const Metric& m);
Ruler (Canvas*, const Metric& m, Rect const&);
Ruler (Item*, const Metric& m);
Ruler (Item*, const Metric& m, Rect const&);
-
+
void set_range (double lower, double upper);
void set_font_description (Pango::FontDescription);
void set_metric (const Metric&);
diff --git a/libs/canvas/canvas/scroll_group.h b/libs/canvas/canvas/scroll_group.h
index fd9b2388d4..0317662006 100644
--- a/libs/canvas/canvas/scroll_group.h
+++ b/libs/canvas/canvas/scroll_group.h
@@ -34,7 +34,7 @@ class LIBCANVAS_API ScrollGroup : public Container
ScrollsVertically = 0x1,
ScrollsHorizontally = 0x2
};
-
+
ScrollGroup (Canvas*, ScrollSensitivity);
ScrollGroup (Item*, ScrollSensitivity);
diff --git a/libs/canvas/canvas/tracking_text.h b/libs/canvas/canvas/tracking_text.h
index 901e5c2925..744e5370fb 100644
--- a/libs/canvas/canvas/tracking_text.h
+++ b/libs/canvas/canvas/tracking_text.h
@@ -29,7 +29,7 @@ class LIBCANVAS_API TrackingText : public Text
public:
TrackingText (Canvas*);
TrackingText (Item*);
-
+
void show_and_track (bool track_x, bool track_y);
void set_offset (Duple const &);
void set_x_offset (double);
diff --git a/libs/canvas/canvas/types.h b/libs/canvas/canvas/types.h
index c43be9bbdd..a92d637925 100644
--- a/libs/canvas/canvas/types.h
+++ b/libs/canvas/canvas/types.h
@@ -60,12 +60,12 @@ struct LIBCANVAS_API Duple
: x (0)
, y (0)
{}
-
+
Duple (Coord x_, Coord y_)
: x (x_)
, y (y_)
{}
-
+
Coord x;
Coord y;
@@ -104,14 +104,14 @@ struct LIBCANVAS_API Rect
, x1 (0)
, y1 (0)
{}
-
+
Rect (Coord x0_, Coord y0_, Coord x1_, Coord y1_)
: x0 (x0_)
, y0 (y0_)
, x1 (x1_)
, y1 (y1_)
{}
-
+
Coord x0;
Coord y0;
Coord x1;
@@ -120,14 +120,14 @@ struct LIBCANVAS_API Rect
boost::optional<Rect> intersection (Rect const & o) const throw () {
Rect i (std::max (x0, o.x0), std::max (y0, o.y0),
std::min (x1, o.x1), std::min (y1, o.y1));
-
+
if (i.x0 > i.x1 || i.y0 > i.y1) {
return boost::optional<Rect> ();
}
-
+
return boost::optional<Rect> (i);
}
-
+
Rect extend (Rect const & o) const throw () {
return Rect (std::min (x0, o.x0), std::min (y0, o.y0),
std::max (x1, o.x1), std::max (y1, o.y1));
@@ -150,7 +150,7 @@ struct LIBCANVAS_API Rect
return Rect (canvas_safe_add (x0, amount), canvas_safe_add (y0, amount),
x1 - amount, y1 - amount);
}
-
+
bool contains (Duple const & point) const throw () {
return point.x >= x0 && point.x < x1 && point.y >= y0 && point.y < y1;
}
@@ -158,7 +158,7 @@ struct LIBCANVAS_API Rect
return Rect (std::min (x0, x1), std::min (y0, y1),
std::max (x0, x1), std::max (y0, y1));
}
-
+
bool empty() const throw () { return (x0 == x1 && y0 == y1); }
Distance width () const throw () {
@@ -181,5 +181,5 @@ extern LIBCANVAS_API std::ostream & operator<< (std::ostream &, Rect const &);
typedef std::vector<Duple> Points;
}
-
+
#endif
diff --git a/libs/canvas/canvas/wave_view.h b/libs/canvas/canvas/wave_view.h
index 20c3ad5cce..8dfd988b6b 100644
--- a/libs/canvas/canvas/wave_view.h
+++ b/libs/canvas/canvas/wave_view.h
@@ -42,7 +42,7 @@ namespace Gdk {
}
class WaveViewTest;
-
+
namespace ArdourCanvas {
struct LIBCANVAS_API WaveViewThreadRequest
@@ -55,10 +55,10 @@ struct LIBCANVAS_API WaveViewThreadRequest
};
WaveViewThreadRequest () : stop (0) {}
-
+
bool should_stop () const { return (bool) g_atomic_int_get (const_cast<gint*>(&stop)); }
void cancel() { g_atomic_int_set (&stop, 1); }
-
+
RequestType type;
framepos_t start;
framepos_t end;
@@ -71,9 +71,9 @@ struct LIBCANVAS_API WaveViewThreadRequest
boost::weak_ptr<const ARDOUR::Region> region;
/* resulting image, after request has been satisfied */
-
+
Cairo::RefPtr<Cairo::ImageSurface> image;
-
+
private:
gint stop; /* intended for atomic access */
};
@@ -85,7 +85,7 @@ class LIBCANVAS_API WaveViewCache
public:
WaveViewCache();
~WaveViewCache();
-
+
struct Entry {
/* these properties define the cache entry as unique.
@@ -111,7 +111,7 @@ class LIBCANVAS_API WaveViewCache
/* last time the cache entry was used */
uint64_t timestamp;
-
+
Entry (int chan, Coord hght, float amp, Color fcl, double spp, framepos_t strt, framepos_t ed,
Cairo::RefPtr<Cairo::ImageSurface> img)
: channel (chan)
@@ -127,10 +127,10 @@ class LIBCANVAS_API WaveViewCache
uint64_t image_cache_threshold () const { return _image_cache_threshold; }
void set_image_cache_threshold (uint64_t);
void clear_cache ();
-
+
void add (boost::shared_ptr<ARDOUR::AudioSource>, boost::shared_ptr<Entry>);
void use (boost::shared_ptr<ARDOUR::AudioSource>, boost::shared_ptr<Entry>);
-
+
void consolidate_image_cache (boost::shared_ptr<ARDOUR::AudioSource>,
int channel,
Coord height,
@@ -196,18 +196,18 @@ public:
Cairo::RefPtr<Cairo::ImageSurface> _image;
PBD::Signal0<void> ImageReady;
-
+
/* Displays a single channel of waveform data for the given Region.
x = 0 in the waveview corresponds to the first waveform datum taken
from region->start() samples into the source data.
-
+
x = N in the waveview corresponds to the (N * spp)'th sample
measured from region->start() into the source data.
-
+
when drawing, we will map the zeroth-pixel of the waveview
into a window.
-
+
The waveview itself contains a set of pre-rendered Cairo::ImageSurfaces
that cache sections of the display. This is filled on-demand and
never cleared until something explicitly marks the cache invalid
@@ -235,10 +235,10 @@ public:
* want this behaviour.
*/
void set_start_shift (double pixels);
-
+
void set_fill_color (Color);
void set_outline_color (Color);
-
+
void region_resized ();
void gain_changed ();
@@ -277,8 +277,8 @@ public:
static void stop_drawing_thread ();
static void set_image_cache_size (uint64_t);
-
-#ifdef CANVAS_COMPATIBILITY
+
+#ifdef CANVAS_COMPATIBILITY
void*& property_gain_src () {
return _foo_void;
}
@@ -312,7 +312,7 @@ public:
double _amplitude_above_axis;
float _region_amplitude;
double _start_shift;
-
+
/** The `start' value to use for the region; we can't use the region's
* value as the crossfade editor needs to alter it.
*/
@@ -340,14 +340,14 @@ public:
keep updating (e.g. while recording)
*/
bool always_get_image_in_thread;
-
+
/** Set to true by render(). Used so that we know if the wave view
* has actually been displayed on screen. ::set_height() when this
* is true does not use get_image_in_thread, because it implies
* that the height is being set BEFORE the waveview is drawn.
*/
mutable bool rendered;
-
+
PBD::ScopedConnectionList invalidation_connection;
PBD::ScopedConnection image_ready_connection;
@@ -364,14 +364,14 @@ public:
boost::shared_ptr<WaveViewCache::Entry> get_image (framepos_t start, framepos_t end, bool& full_image) const;
boost::shared_ptr<WaveViewCache::Entry> get_image_from_cache (framepos_t start, framepos_t end, bool& full_image) const;
-
+
struct LineTips {
double top;
double bot;
double spread;
bool clip_max;
bool clip_min;
-
+
LineTips() : top (0.0), bot (0.0), clip_max (false), clip_min (false) {}
};
@@ -382,7 +382,7 @@ public:
void draw_image (Cairo::RefPtr<Cairo::ImageSurface>&, ARDOUR::PeakData*, int n_peaks, boost::shared_ptr<WaveViewThreadRequest>) const;
void draw_absent_image (Cairo::RefPtr<Cairo::ImageSurface>&, ARDOUR::PeakData*, int) const;
-
+
void cancel_my_render_request () const;
void queue_get_image (boost::shared_ptr<const ARDOUR::Region> region, framepos_t start, framepos_t end) const;
@@ -394,7 +394,7 @@ public:
mutable boost::shared_ptr<WaveViewCache::Entry> _current_image;
mutable boost::shared_ptr<WaveViewThreadRequest> current_request;
-
+
static WaveViewCache* images;
static void drawing_thread ();
diff --git a/libs/canvas/canvas/widget.h b/libs/canvas/canvas/widget.h
index 590bb3af7d..127862037c 100644
--- a/libs/canvas/canvas/widget.h
+++ b/libs/canvas/canvas/widget.h
@@ -33,7 +33,7 @@ class LIBCANVAS_API Widget : public Item
public:
Widget (Canvas*, CairoWidget&);
Widget (Item*, CairoWidget&);
-
+
void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
void compute_bounding_box () const;
diff --git a/libs/canvas/colors.cc b/libs/canvas/colors.cc
index 03bfd8d4ce..19c5226642 100644
--- a/libs/canvas/colors.cc
+++ b/libs/canvas/colors.cc
@@ -55,9 +55,9 @@ ArdourCanvas::color_to_hsva (Color color, double& h, double& s, double& v, doubl
double cmax;
double cmin;
double delta;
-
+
color_to_rgba (color, r, g, b, a);
-
+
if (r > g) {
cmax = max (r, b);
} else {
@@ -81,7 +81,7 @@ ArdourCanvas::color_to_hsva (Color color, double& h, double& s, double& v, doubl
return;
}
- if (delta != 0.0) {
+ if (delta != 0.0) {
if (cmax == r) {
h = fmod ((g - b)/delta, 6.0);
} else if (cmax == g) {
@@ -89,9 +89,9 @@ ArdourCanvas::color_to_hsva (Color color, double& h, double& s, double& v, doubl
} else {
h = ((r - g)/delta) + 4;
}
-
+
h *= 60.0;
-
+
if (h < 0.0) {
/* negative values are legal but confusing, because
they alias positive values.
@@ -341,7 +341,7 @@ HSV
HSV::shade (double factor) const
{
HSV hsv (*this);
-
+
/* algorithm derived from a google palette website
and analysis of their color palettes.
@@ -423,10 +423,10 @@ HSV::distance (const HSV& other) const
perceptual distance of sqrt ((360^2) + 1 + 1) = 360. The 450
are not evenly spread (Webers Law), so lets use 360 as an
approximation of the number of distinct achromatics.
-
+
So, scale up the achromatic difference to give about
a maximal distance between v = 1.0 and v = 0.0 of 360.
-
+
A difference of about 0.0055 will generate a return value of
2, which is roughly the limit of human perceptual
discrimination for chromatics.
@@ -467,7 +467,7 @@ HSV::distance (const HSV& other) const
const double xDE = sqrt (((sL - oL) * (sL - oL))
+ ((sA - oA) * (sA - oA))
+ ((sB - oB) * (sB - oB)));
-
+
double xDH;
if (sqrt (xDE) > (sqrt (abs (xDL)) + sqrt (abs (xDC)))) {
@@ -482,7 +482,7 @@ HSV::distance (const HSV& other) const
xDL /= whtL;
xDC /= whtC * xSC;
xDH /= whtH * xSH;
-
+
return sqrt ((xDL * xDL) + (xDC * xDC) + (xDH * xDH));
}
@@ -630,7 +630,7 @@ HSV
SVAModifier::operator () (HSV& hsv) const
{
HSV r (hsv);
-
+
switch (type) {
case Add:
r.s += _s;
diff --git a/libs/canvas/colorspace.cc b/libs/canvas/colorspace.cc
index f4480e7dc0..50cbac8fb1 100644
--- a/libs/canvas/colorspace.cc
+++ b/libs/canvas/colorspace.cc
@@ -373,16 +373,16 @@ void Rgb2Hsv(double *H, double *S, double *V, double R, double G, double B)
double Max = MAX3(R, G, B);
double Min = MIN3(R, G, B);
double C = Max - Min;
-
-
+
+
*V = Max;
-
+
if(C > 0)
{
if(Max == R)
{
*H = (G - B) / C;
-
+
if(G < B)
*H += 6;
}
@@ -390,7 +390,7 @@ void Rgb2Hsv(double *H, double *S, double *V, double R, double G, double B)
*H = 2 + (B - R) / C;
else
*H = 4 + (R - G) / C;
-
+
*H *= 60;
*S = C / Max;
}
@@ -419,12 +419,12 @@ void Hsv2Rgb(double *R, double *G, double *B, double H, double S, double V)
double C = S * V;
double Min = V - C;
double X;
-
-
+
+
H -= 360*floor(H/360);
H /= 60;
X = C*(1 - fabs(H - 2*floor(H/2) - 1));
-
+
switch((int)H)
{
case 0:
@@ -485,16 +485,16 @@ void Rgb2Hsl(double *H, double *S, double *L, double R, double G, double B)
double Max = MAX3(R, G, B);
double Min = MIN3(R, G, B);
double C = Max - Min;
-
-
+
+
*L = (Max + Min)/2;
-
+
if(C > 0)
{
if(Max == R)
{
*H = (G - B) / C;
-
+
if(G < B)
*H += 6;
}
@@ -502,7 +502,7 @@ void Rgb2Hsl(double *H, double *S, double *L, double R, double G, double B)
*H = 2 + (B - R) / C;
else
*H = 4 + (R - G) / C;
-
+
*H *= 60;
*S = (*L <= 0.5) ? (C/(2*(*L))) : (C/(2 - 2*(*L)));
}
@@ -531,12 +531,12 @@ void Hsl2Rgb(double *R, double *G, double *B, double H, double S, double L)
double C = (L <= 0.5) ? (2*L*S) : ((2 - 2*L)*S);
double Min = L - 0.5*C;
double X;
-
-
+
+
H -= 360*floor(H/360);
H /= 60;
X = C*(1 - fabs(H - 2*floor(H/2) - 1));
-
+
switch((int)H)
{
case 0:
@@ -594,15 +594,15 @@ void Rgb2Hsi(double *H, double *S, double *I, double R, double G, double B)
{
double alpha = 0.5*(2*R - G - B);
double beta = 0.866025403784439*(G - B);
-
-
+
+
*I = (R + G + B)/3;
-
+
if(*I > 0)
{
*S = 1 - MIN3(R,G,B) / *I;
*H = atan2(beta, alpha)*(180/M_PI);
-
+
if(*H < 0)
*H += 360;
}
@@ -629,7 +629,7 @@ void Rgb2Hsi(double *H, double *S, double *I, double R, double G, double B)
void Hsi2Rgb(double *R, double *G, double *B, double H, double S, double I)
{
H -= 360*floor(H/360);
-
+
if(H < 120)
{
*B = I*(1 - S);
@@ -695,16 +695,16 @@ void Rgb2Xyz(double *X, double *Y, double *Z, double R, double G, double B)
* Wikipedia: http://en.wikipedia.org/wiki/CIE_1931_color_space
*/
void Xyz2Rgb(double *R, double *G, double *B, double X, double Y, double Z)
-{
+{
double R1, B1, G1, Min;
-
-
+
+
R1 = (double)( 3.2406*X - 1.5372*Y - 0.4986*Z);
G1 = (double)(-0.9689*X + 1.8758*Y + 0.0415*Z);
B1 = (double)( 0.0557*X - 0.2040*Y + 1.0570*Z);
-
+
Min = MIN3(R1, G1, B1);
-
+
/* Force nonnegative values so that gamma correction is well-defined. */
if(Min < 0)
{
@@ -770,9 +770,9 @@ void Lab2Xyz(double *X, double *Y, double *Z, double L, double a, double b)
* Wikipedia: http://en.wikipedia.org/wiki/CIELUV_color_space
*/
void Xyz2Luv(double *L, double *u, double *v, double X, double Y, double Z)
-{
+{
double u1, v1, Denom;
-
+
if((Denom = X + 15*Y + 3*Z) > 0)
{
@@ -802,13 +802,13 @@ void Luv2Xyz(double *X, double *Y, double *Z, double L, double u, double v)
{
*Y = (L + 16)/116;
*Y = WHITEPOINT_Y*LABINVF(*Y);
-
+
if(L != 0)
{
u /= L;
v /= L;
}
-
+
u = u/13 + WHITEPOINT_U;
v = v/13 + WHITEPOINT_V;
*X = (*Y) * ((9*u)/(4*v));
@@ -829,12 +829,12 @@ void Luv2Xyz(double *X, double *Y, double *Z, double L, double u, double v)
void Xyz2Lch(double *L, double *C, double *H, double X, double Y, double Z)
{
double a, b;
-
-
+
+
Xyz2Lab(L, &a, &b, X, Y, Z);
*C = sqrt(a*a + b*b);
*H = atan2(b, a)*180.0/M_PI;
-
+
if(*H < 0)
*H += 360;
}
@@ -849,8 +849,8 @@ void Lch2Xyz(double *X, double *Y, double *Z, double L, double C, double H)
{
double a = C * cos(H*(M_PI/180.0));
double b = C * sin(H*(M_PI/180.0));
-
-
+
+
Lab2Xyz(X, Y, Z, L, a, b);
}
diff --git a/libs/canvas/curve.cc b/libs/canvas/curve.cc
index 78d47f07e9..280a3e3aaa 100644
--- a/libs/canvas/curve.cc
+++ b/libs/canvas/curve.cc
@@ -101,7 +101,7 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
* section of the curve. For now we rely on cairo clipping to help
* with this.
*/
-
+
setup_outline_context (context);
@@ -165,7 +165,7 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
draw = draw.expand (4.0);
/* now clip it to the actual points in the curve */
-
+
if (draw.x0 < w1.x) {
draw.x0 = w1.x;
}
diff --git a/libs/canvas/debug.cc b/libs/canvas/debug.cc
index be5b3a033d..086c69b7a7 100644
--- a/libs/canvas/debug.cc
+++ b/libs/canvas/debug.cc
@@ -55,7 +55,7 @@ ArdourCanvas::checkpoint (string group, string message)
now.tv_usec += 1e6;
--now.tv_sec;
}
-
+
map<string, struct timeval>::iterator last = last_time.find (group);
if (last != last_time.end ()) {
diff --git a/libs/canvas/fill.cc b/libs/canvas/fill.cc
index bf72c678aa..42fe155684 100644
--- a/libs/canvas/fill.cc
+++ b/libs/canvas/fill.cc
@@ -84,19 +84,19 @@ void
Fill::setup_gradient_context (Cairo::RefPtr<Cairo::Context> context, Rect const & self, Duple const & draw_origin) const
{
Cairo::RefPtr<Cairo::LinearGradient> _gradient;
-
+
if (_vertical_gradient) {
_gradient = Cairo::LinearGradient::create (draw_origin.x, self.y0, draw_origin.x, self.y1);
} else {
_gradient = Cairo::LinearGradient::create (self.x0, draw_origin.y, self.x1, draw_origin.y);
}
-
+
for (StopList::const_iterator s = _stops.begin(); s != _stops.end(); ++s) {
double r, g, b, a;
color_to_rgba (s->second, r, g, b, a);
_gradient->add_color_stop_rgba (s->first, r, g, b, a);
}
-
+
context->set_source (_gradient);
}
diff --git a/libs/canvas/flag.cc b/libs/canvas/flag.cc
index e3e9e409a2..2d0bdb2830 100644
--- a/libs/canvas/flag.cc
+++ b/libs/canvas/flag.cc
@@ -77,7 +77,7 @@ Flag::set_text (string const & text)
assert (bbox);
Duple flag_size (bbox.get().width() + 10, bbox.get().height() + 4);
-
+
if (_invert) {
const Distance h = fabs(_line->y1() - _line->y0());
_text->set_position (Duple (5, h - flag_size.y + 2));
diff --git a/libs/canvas/image.cc b/libs/canvas/image.cc
index d6c42d28ef..b42c7053a8 100644
--- a/libs/canvas/image.cc
+++ b/libs/canvas/image.cc
@@ -53,7 +53,7 @@ Image::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) const
_pending->stride);
_current = _pending;
}
-
+
Rect self = item_to_window (Rect (0, 0, _width, _height));
boost::optional<Rect> draw = self.intersection (area);
@@ -103,5 +103,5 @@ Image::accept_data ()
begin_change ();
_need_render = true;
end_change (); // notify canvas that we need redrawing
-}
+}
diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc
index ab68ea2e95..47eb77d7a3 100644
--- a/libs/canvas/item.cc
+++ b/libs/canvas/item.cc
@@ -46,7 +46,7 @@ Item::Item (Canvas* canvas)
, _ignore_events (false)
{
DEBUG_TRACE (DEBUG::CanvasItems, string_compose ("new canvas item %1\n", this));
-}
+}
Item::Item (Item* parent)
: Fill (*this)
@@ -66,7 +66,7 @@ Item::Item (Item* parent)
}
find_scroll_parent ();
-}
+}
Item::Item (Item* parent, Duple const& p)
: Fill (*this)
@@ -88,7 +88,7 @@ Item::Item (Item* parent, Duple const& p)
find_scroll_parent ();
-}
+}
Item::~Item ()
{
@@ -196,7 +196,7 @@ void
Item::item_to_canvas (Coord& x, Coord& y) const
{
Duple d = item_to_canvas (Duple (x, y));
-
+
x = d.x;
y = d.y;
}
@@ -268,16 +268,16 @@ Item::set_position (Duple p)
*/
pre_change_parent_bounding_box = item_to_parent (bbox.get());
}
-
+
_position = p;
/* only update canvas and parent if visible. Otherwise, this
will be done when ::show() is called.
*/
-
+
if (visible()) {
_canvas->item_moved (this, pre_change_parent_bounding_box);
-
+
if (_parent) {
_parent->child_changed ();
@@ -347,7 +347,7 @@ Item::hide ()
}
}
-
+
propagate_show_hide ();
}
}
@@ -376,11 +376,11 @@ void
Item::propagate_show_hide ()
{
/* bounding box may have changed while we were hidden */
-
+
if (_parent) {
_parent->child_changed ();
}
-
+
_canvas->item_shown_or_hidden (this);
}
@@ -450,7 +450,7 @@ Item::find_scroll_parent ()
}
i = i->parent();
}
-
+
_scroll_parent = const_cast<ScrollGroup*> (last_scroll_group);
}
@@ -461,7 +461,7 @@ Item::common_ancestor_within (uint32_t limit, const Item& other) const
uint32_t d2 = other.depth();
const Item* i1 = this;
const Item* i2 = &other;
-
+
/* move towards root until we are at the same level
for both items
*/
@@ -502,7 +502,7 @@ Item::common_ancestor_within (uint32_t limit, const Item& other) const
return false;
}
}
-
+
return true;
}
@@ -544,7 +544,7 @@ Item::closest_ancestor_with (const Item& other) const
i2 = i2->parent ();
}
}
-
+
return i1;
}
@@ -611,7 +611,7 @@ Item::redraw () const
if (visible() && _bounding_box && _canvas) {
_canvas->request_redraw (item_to_window (_bounding_box.get()));
}
-}
+}
void
Item::begin_change ()
@@ -624,7 +624,7 @@ Item::end_change ()
{
if (visible()) {
_canvas->item_changed (this, _pre_change_bounding_box);
-
+
if (_parent) {
_parent->child_changed ();
}
@@ -677,7 +677,7 @@ Item::get_data (string const & key) const
if (i == _data.end ()) {
return 0;
}
-
+
return i->second;
}
@@ -745,7 +745,7 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
#endif
++render_depth;
-
+
for (std::vector<Item*>::const_iterator i = items.begin(); i != items.end(); ++i) {
if (!(*i)->visible ()) {
@@ -756,7 +756,7 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
#endif
continue;
}
-
+
boost::optional<Rect> item_bbox = (*i)->bounding_box ();
if (!item_bbox) {
@@ -767,10 +767,10 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
#endif
continue;
}
-
+
Rect item = (*i)->item_to_window (item_bbox.get(), false);
boost::optional<Rect> d = item.intersection (area);
-
+
if (d) {
Rect draw = d.get();
if (draw.width() && draw.height()) {
@@ -891,7 +891,7 @@ Item::remove (Item* i)
_items.remove (i);
invalidate_lut ();
_bounding_box_dirty = true;
-
+
end_change ();
}
@@ -925,7 +925,7 @@ Item::clear_items (bool with_delete)
_items.erase (i);
item->unparent ();
-
+
if (with_delete) {
delete item;
}
@@ -1069,7 +1069,7 @@ Item::dump (ostream& o) const
o << _canvas->indent() << whatami() << ' ' << this << " self-Visible ? " << self_visible() << " visible ? " << visible();
o << " @ " << position();
-
+
#ifdef CANVAS_DEBUG
if (!name.empty()) {
o << ' ' << name;
@@ -1093,25 +1093,25 @@ Item::dump (ostream& o) const
o << " Items: " << _items.size();
o << " Self-Visible ? " << self_visible();
o << " Visible ? " << visible();
-
+
boost::optional<Rect> bb = bounding_box();
-
+
if (bb) {
o << endl << _canvas->indent() << " bbox: " << bb.get();
o << endl << _canvas->indent() << " CANVAS bbox: " << item_to_canvas (bb.get());
} else {
o << " bbox unset";
}
-
+
o << endl;
#endif
-
+
ArdourCanvas::dump_depth++;
-
+
for (list<Item*>::const_iterator i = _items.begin(); i != _items.end(); ++i) {
o << **i;
}
-
+
ArdourCanvas::dump_depth--;
}
}
diff --git a/libs/canvas/line.cc b/libs/canvas/line.cc
index 8bd26b9067..49d2987e3d 100644
--- a/libs/canvas/line.cc
+++ b/libs/canvas/line.cc
@@ -43,7 +43,7 @@ void
Line::compute_bounding_box () const
{
Rect bbox;
-
+
bbox.x0 = min (_points[0].x, _points[1].x);
bbox.y0 = min (_points[0].y, _points[1].y);
bbox.x1 = max (_points[0].x, _points[1].x);
@@ -66,7 +66,7 @@ Line::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) cons
if (_outline_width <= 1.0) {
/* See Cairo FAQ on single pixel lines to understand why we add 0.5
*/
-
+
const Duple half_a_pixel (0.5, 0.5);
p0 = p0.translate (half_a_pixel);
p1 = p1.translate (half_a_pixel);
@@ -82,10 +82,10 @@ Line::set (Duple a, Duple b)
{
if (a != _points[0] || b != _points[1]) {
begin_change ();
-
+
_points[0] = a;
_points[1] = b;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -96,23 +96,23 @@ Line::set_x (Coord x0, Coord x1)
{
if (x0 != _points[0].x || x1 != _points[1].x) {
begin_change ();
-
+
_points[0].x = x0;
_points[1].x = x1;
-
+
_bounding_box_dirty = true;
end_change ();
}
-}
+}
void
Line::set_x0 (Coord x0)
{
if (x0 != _points[0].x) {
begin_change ();
-
+
_points[0].x = x0;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -123,9 +123,9 @@ Line::set_y0 (Coord y0)
{
if (y0 != _points[0].y) {
begin_change ();
-
+
_points[0].y = y0;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -138,9 +138,9 @@ Line::set_x1 (Coord x1)
{
if (x1 != _points[1].x) {
begin_change ();
-
+
_points[1].x = x1;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -151,9 +151,9 @@ Line::set_y1 (Coord y1)
{
if (y1 != _points[1].y) {
begin_change ();
-
+
_points[1].y = y1;
-
+
_bounding_box_dirty = true;
end_change ();
}
diff --git a/libs/canvas/line_set.cc b/libs/canvas/line_set.cc
index 54fe980b1c..03f2f0abf1 100644
--- a/libs/canvas/line_set.cc
+++ b/libs/canvas/line_set.cc
@@ -54,7 +54,7 @@ LineSet::compute_bounding_box () const
} else {
if (_orientation == Horizontal) {
-
+
_bounding_box = Rect (0, /* x0 */
_lines.front().pos - (_lines.front().width/2.0), /* y0 */
_extent, /* x1 */
@@ -62,7 +62,7 @@ LineSet::compute_bounding_box () const
);
} else {
-
+
_bounding_box = Rect (_lines.front().pos - _lines.front().width/2.0, /* x0 */
0, /* y0 */
_lines.back().pos + _lines.back().width/2.0, /* x1 */
@@ -101,9 +101,9 @@ LineSet::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
}
boost::optional<Rect> isect = self.intersection (area);
-
+
if (!isect) {
- continue;
+ continue;
}
Rect intersection (isect.get());
@@ -134,7 +134,7 @@ void
LineSet::add (Coord y, Distance width, Color color)
{
begin_change ();
-
+
_lines.push_back (Line (y, width, color));
sort (_lines.begin(), _lines.end(), LineSorter());
diff --git a/libs/canvas/lookup_table.cc b/libs/canvas/lookup_table.cc
index c50f010dc8..3836ccd18a 100644
--- a/libs/canvas/lookup_table.cc
+++ b/libs/canvas/lookup_table.cc
@@ -92,11 +92,11 @@ DumbLookupTable::has_item_at_point (Duple const & point) const
if (!(*i)->visible()) {
continue;
}
-
+
if ((*i)->covers (point)) {
// std::cerr << "\t\t" << (*i)->whatami() << '/' << (*i)->name << " covers " << point << std::endl;
return true;
-
+
}
}
@@ -235,7 +235,7 @@ OptimizingLookupTable::items_at_point (Duple const & point) const
if (y >= _dimension) {
cout << "WARNING: y=" << y << ", dim=" << _dimension << ", py=" << point.y << " cellsize=" << _cell_size << "\n";
}
-
+
/* XXX: hmm */
x = min (_dimension - 1, x);
y = min (_dimension - 1, y);
@@ -272,7 +272,7 @@ OptimizingLookupTable::has_item_at_point (Duple const & point) const
if (y >= _dimension) {
cout << "WARNING: y=" << y << ", dim=" << _dimension << ", py=" << point.y << " cellsize=" << _cell_size << "\n";
}
-
+
/* XXX: hmm */
x = min (_dimension - 1, x);
y = min (_dimension - 1, y);
@@ -294,7 +294,7 @@ OptimizingLookupTable::has_item_at_point (Duple const & point) const
return false;
}
-
+
/** @param area Area in our owning item's coordinates */
vector<Item*>
OptimizingLookupTable::get (Rect const & area)
@@ -321,7 +321,7 @@ OptimizingLookupTable::get (Rect const & area)
vector<Item*> vitems;
copy (items.begin (), items.end (), back_inserter (vitems));
-
+
return vitems;
}
diff --git a/libs/canvas/pixbuf.cc b/libs/canvas/pixbuf.cc
index d285c41b10..5bb9e63d1e 100644
--- a/libs/canvas/pixbuf.cc
+++ b/libs/canvas/pixbuf.cc
@@ -41,7 +41,7 @@ Pixbuf::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) co
Gdk::Cairo::set_source_pixbuf (context, _pixbuf, 0, 0);
context->paint ();
}
-
+
void
Pixbuf::compute_bounding_box () const
{
@@ -58,7 +58,7 @@ void
Pixbuf::set (Glib::RefPtr<Gdk::Pixbuf> pixbuf)
{
begin_change ();
-
+
_pixbuf = pixbuf;
_bounding_box_dirty = true;
diff --git a/libs/canvas/poly_item.cc b/libs/canvas/poly_item.cc
index b6c97c3a3b..855140856e 100644
--- a/libs/canvas/poly_item.cc
+++ b/libs/canvas/poly_item.cc
@@ -40,12 +40,12 @@ PolyItem::PolyItem (Item* parent)
void
PolyItem::compute_bounding_box () const
{
-
+
if (!_points.empty()) {
Rect bbox;
Points::const_iterator i = _points.begin();
-
+
bbox.x0 = bbox.x1 = i->x;
bbox.y0 = bbox.y1 = i->y;
@@ -61,11 +61,11 @@ PolyItem::compute_bounding_box () const
_bounding_box = bbox.expand (_outline_width + 0.5);
-
+
} else {
_bounding_box = boost::optional<Rect> ();
}
-
+
_bounding_box_dirty = false;
}
@@ -113,14 +113,14 @@ PolyItem::render_curve (Rect const & area, Cairo::RefPtr<Cairo::Context> context
Duple c2 = item_to_window (Duple (cp2->x, cp2->y));
c = item_to_window (Duple (p->x, p->y));
-
+
context->curve_to (c1.x + pixel_adjust,
c1.y + pixel_adjust,
c2.x + pixel_adjust,
c2.y + pixel_adjust,
c.x + pixel_adjust,
c.y + pixel_adjust);
-
+
++cp1;
++cp2;
++p;
@@ -133,9 +133,9 @@ PolyItem::set (Points const & points)
if (_points != points) {
begin_change ();
-
+
_points = points;
-
+
_bounding_box_dirty = true;
end_change ();
}
diff --git a/libs/canvas/poly_line.cc b/libs/canvas/poly_line.cc
index 3150907db6..5d6abb9814 100644
--- a/libs/canvas/poly_line.cc
+++ b/libs/canvas/poly_line.cc
@@ -77,7 +77,7 @@ PolyLine::covers (Duple const & point) const
Duple p = window_to_item (point);
const Points::size_type npoints = _points.size();
-
+
if (npoints < 2) {
return false;
}
@@ -95,30 +95,30 @@ PolyLine::covers (Duple const & point) const
double t;
Duple a (_points[j]);
Duple b (_points[i]);
-
+
/*
Clamp the line endpoints to the visible area of the canvas. If we do
not do this, we may have a line segment extending to COORD_MAX and our
math goes wrong.
*/
-
+
a.x = std::min (a.x, visible.x1);
a.y = std::min (a.y, visible.y1);
b.x = std::min (b.x, visible.x1);
b.y = std::min (b.y, visible.y1);
-
+
double d = distance_to_segment_squared (p, a, b, t, at);
-
+
if (t < 0.0 || t > 1.0) {
continue;
}
-
+
if (d < _threshold + _outline_width) {
return true;
}
-
+
}
-
+
return false;
}
diff --git a/libs/canvas/polygon.cc b/libs/canvas/polygon.cc
index 5aa58eb614..53fea1c5f4 100644
--- a/libs/canvas/polygon.cc
+++ b/libs/canvas/polygon.cc
@@ -48,7 +48,7 @@ Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
if (_outline || _fill) {
render_path (area, context);
-
+
if (!_points.empty ()) {
/* close path */
Duple p = item_to_window (Duple (_points.front().x, _points.front().y));
@@ -119,11 +119,11 @@ Polygon::covers (Duple const & point) const
Points::size_type i;
Points::size_type j = npoints -1;
bool oddNodes = false;
-
+
if (_bounding_box_dirty) {
compute_bounding_box ();
}
-
+
for (i = 0; i < npoints; i++) {
if (((_points[i].y < p.y && _points[j].y >= p.y) || (_points[j].y < p.y && _points[i].y >= p.y))) {
oddNodes ^= (p.y * multiple[i] + constant[i] < p.x);
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc
index e6ff6b37d0..64cdd3af8a 100644
--- a/libs/canvas/rectangle.cc
+++ b/libs/canvas/rectangle.cc
@@ -72,7 +72,7 @@ void
Rectangle::render_self (Rect const & area, Cairo::RefPtr<Cairo::Context> context, Rect self) const
{
boost::optional<Rect> r = self.intersection (area);
-
+
if (!r) {
return;
}
@@ -89,11 +89,11 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr<Cairo::Context> context
context->rectangle (draw.x0, draw.y0, draw.width(), draw.height());
context->fill ();
}
-
+
if (_outline) {
setup_outline_context (context);
-
+
/* the goal here is that if the border is 1 pixel
* thick, it will precisely align with the corner
* coordinates of the rectangle. So if the rectangle
@@ -111,9 +111,9 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr<Cairo::Context> context
const double shift = _outline_width * 0.5;
self = self.translate (Duple (shift, shift));
}
-
+
if (_outline_what == What (LEFT|RIGHT|BOTTOM|TOP)) {
-
+
context->rectangle (self.x0, self.y0, self.width(), self.height());
} else {
@@ -122,7 +122,7 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr<Cairo::Context> context
context->move_to (self.x0, self.y0);
context->line_to (self.x0, self.y1);
}
-
+
if (_outline_what & TOP) {
context->move_to (self.x0, self.y0);
context->line_to (self.x1, self.y0);
@@ -132,13 +132,13 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr<Cairo::Context> context
context->move_to (self.x0, self.y1);
context->line_to (self.x1, self.y1);
}
-
+
if (_outline_what & RIGHT) {
context->move_to (self.x1, self.y0);
context->line_to (self.x1, self.y1);
}
}
-
+
context->stroke ();
}
}
@@ -195,11 +195,11 @@ Rectangle::set (Rect const & r)
*/
if (r != _rect) {
-
+
begin_change ();
-
+
_rect = r;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -210,9 +210,9 @@ Rectangle::set_x0 (Coord x0)
{
if (x0 != _rect.x0) {
begin_change ();
-
+
_rect.x0 = x0;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -223,9 +223,9 @@ Rectangle::set_y0 (Coord y0)
{
if (y0 != _rect.y0) {
begin_change ();
-
+
_rect.y0 = y0;
-
+
_bounding_box_dirty = true;
end_change();
}
@@ -236,9 +236,9 @@ Rectangle::set_x1 (Coord x1)
{
if (x1 != _rect.x1) {
begin_change ();
-
+
_rect.x1 = x1;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -249,9 +249,9 @@ Rectangle::set_y1 (Coord y1)
{
if (y1 != _rect.y1) {
begin_change ();
-
+
_rect.y1 = y1;
-
+
_bounding_box_dirty = true;
end_change ();
}
diff --git a/libs/canvas/root_group.cc b/libs/canvas/root_group.cc
index accbcb9b30..141cee4f67 100644
--- a/libs/canvas/root_group.cc
+++ b/libs/canvas/root_group.cc
@@ -28,7 +28,7 @@ Root::Root (Canvas* canvas)
{
#ifdef CANVAS_DEBUG
name = "ROOT";
-#endif
+#endif
}
void
diff --git a/libs/canvas/ruler.cc b/libs/canvas/ruler.cc
index b538cbb314..e3f23fb10c 100644
--- a/libs/canvas/ruler.cc
+++ b/libs/canvas/ruler.cc
@@ -137,7 +137,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr<Cairo::Context> cr) const
cr->stroke ();
/* draw ticks + text */
-
+
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (cr);
if (_font_description) {
layout->set_font_description (*_font_description);
@@ -155,7 +155,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr<Cairo::Context> cr) const
} else {
cr->move_to (pos.x, pos.y);
}
-
+
switch (m->style) {
case Mark::Major:
if (_divide_height >= 0) {
@@ -180,7 +180,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr<Cairo::Context> cr) const
layout->set_text (m->label);
logical = layout->get_pixel_logical_extents ();
-
+
if (_divide_height >= 0) {
cr->move_to (pos.x + 2.0, self.y0 + _divide_height + logical.get_y() + 2.0); /* 2 pixel padding below divider */
} else {
diff --git a/libs/canvas/scroll_group.cc b/libs/canvas/scroll_group.cc
index aecea962f6..9e7732b8d2 100644
--- a/libs/canvas/scroll_group.cc
+++ b/libs/canvas/scroll_group.cc
@@ -29,13 +29,13 @@ using namespace ArdourCanvas;
ScrollGroup::ScrollGroup (Canvas* c, ScrollSensitivity s)
: Container (c)
- , _scroll_sensitivity (s)
+ , _scroll_sensitivity (s)
{
}
ScrollGroup::ScrollGroup (Item* parent, ScrollSensitivity s)
: Container (parent)
- , _scroll_sensitivity (s)
+ , _scroll_sensitivity (s)
{
}
@@ -63,7 +63,7 @@ ScrollGroup::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
context->save ();
context->rectangle (self.x0, self.y0, self.width(), self.height());
context->clip ();
-
+
Container::render (area, context);
context->restore ();
diff --git a/libs/canvas/stateful_image.cc b/libs/canvas/stateful_image.cc
index f5cc76dd03..fb0abf44d1 100644
--- a/libs/canvas/stateful_image.cc
+++ b/libs/canvas/stateful_image.cc
@@ -46,7 +46,7 @@ StatefulImage::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
Rect self = item_to_window (Rect (0, 0, image->get_width(), image->get_height()));
boost::optional<Rect> draw = self.intersection (area);
-
+
if (!draw) {
return;
}
@@ -89,14 +89,14 @@ int
StatefulImage::load_states (const XMLNode& node)
{
const XMLNodeList& nodes (node.children());
-
+
_states.clear ();
-
+
for (XMLNodeList::const_iterator i = nodes.begin(); i != nodes.end(); ++i) {
State s;
States::size_type id;
const XMLProperty* prop;
-
+
if ((prop = (*i)->property ("id")) == 0) {
error << _("no ID for state") << endmsg;
continue;
@@ -107,12 +107,12 @@ StatefulImage::load_states (const XMLNode& node)
error << _("no image for state") << endmsg;
continue;
}
-
+
if ((s.image = find_image (prop->value())) == 0) {
error << string_compose (_("image %1 not found for state"), prop->value()) << endmsg;
continue;
}
-
+
if (_states.size() < id) {
_states.reserve (id);
}
@@ -139,7 +139,7 @@ StatefulImage::find_image (const std::string& name)
name) << endmsg;
return ImageHandle();
}
-
+
return Cairo::ImageSurface::create_from_png (path);
}
diff --git a/libs/canvas/test/arrow.cc b/libs/canvas/test/arrow.cc
index 9112b6f52a..ab973bcd2a 100644
--- a/libs/canvas/test/arrow.cc
+++ b/libs/canvas/test/arrow.cc
@@ -28,7 +28,7 @@ ArrowTest::bounding_box ()
arrow.set_outline_width (0);
boost::optional<Rect> bbox = arrow.bounding_box ();
-
+
CPPUNIT_ASSERT (bbox.is_initialized ());
CPPUNIT_ASSERT (bbox.get().x0 == -6);
CPPUNIT_ASSERT (bbox.get().y0 == 0);
diff --git a/libs/canvas/test/group.cc b/libs/canvas/test/group.cc
index 914b940c5e..31b7d13e49 100644
--- a/libs/canvas/test/group.cc
+++ b/libs/canvas/test/group.cc
@@ -87,7 +87,7 @@ GroupTest::layers ()
CPPUNIT_ASSERT (*i++ == &d);
/* Check raise by a number of levels */
-
+
a.raise (2);
i = canvas.root()->items().begin();
@@ -173,7 +173,7 @@ GroupTest::grandchildren_changing ()
/* Change the grandchild and check its parent and grandparent */
a.set (Rect (0, 0, 48, 48));
- bbox = canvas.root()->bounding_box ();
+ bbox = canvas.root()->bounding_box ();
CPPUNIT_ASSERT (bbox.is_initialized ());
CPPUNIT_ASSERT (bbox.get().x0 == 0);
CPPUNIT_ASSERT (bbox.get().y0 == 0);
@@ -193,7 +193,7 @@ void
GroupTest::add_items_at_point ()
{
ImageCanvas canvas;
-
+
Group gA (canvas.root());
gA.set_position (Duple (128, 64));
@@ -274,7 +274,7 @@ GroupTest::torture_add_items_at_point ()
if (canvas.root()->bounding_box() && canvas.root()->bounding_box().get().contains (test)) {
items_B.push_back (canvas.root());
}
-
+
for (list<Item*>::iterator j = rectangles.begin(); j != rectangles.end(); ++j) {
boost::optional<Rect> bbox = (*j)->bounding_box ();
assert (bbox);
@@ -293,4 +293,4 @@ GroupTest::torture_add_items_at_point ()
}
}
}
-
+
diff --git a/libs/canvas/test/gtk_drag.cc b/libs/canvas/test/gtk_drag.cc
index 8628c4cfd4..6e20352199 100644
--- a/libs/canvas/test/gtk_drag.cc
+++ b/libs/canvas/test/gtk_drag.cc
@@ -14,7 +14,7 @@ event (GdkEvent* ev)
{
static bool dragging = false;
static Duple offset;
-
+
if (ev->type == GDK_BUTTON_PRESS) {
GdkEventButton* b = reinterpret_cast<GdkEventButton*> (ev);
if (b->button == 1) {
@@ -38,7 +38,7 @@ event (GdkEvent* ev)
cout << "Move to " << (Duple (m->x, m->y) - offset) << "\n";
}
}
-
+
return true;
}
@@ -62,7 +62,7 @@ int main (int argc, char* argv[])
window.add (viewport);
canvas->show ();
window.show_all ();
-
+
Gtk::Main::run (window);
return 0;
}
diff --git a/libs/canvas/test/gtk_many.cc b/libs/canvas/test/gtk_many.cc
index e75ce05ac0..dda35e4714 100644
--- a/libs/canvas/test/gtk_many.cc
+++ b/libs/canvas/test/gtk_many.cc
@@ -20,20 +20,20 @@ int main (int argc, char* argv[])
double Ns = sqrt (N);
int max_x = 1024;
int max_y = 1024;
-
+
for (int x = 0; x < Ns; ++x) {
for (int y = 0; y < Ns; ++y) {
Rectangle* r = new Rectangle (canvas.root ());
r->set (Rect (x * max_x / Ns, y * max_y / Ns, (x + 1) * max_x / Ns, (y + 1) * max_y / Ns));
}
}
-
+
Gtk::ScrolledWindow scroller;
scroller.add (canvas);
window.add (scroller);
canvas.show ();
window.show_all ();
-
+
Gtk::Main::run (window);
return 0;
}
diff --git a/libs/canvas/test/gtk_movement.cc b/libs/canvas/test/gtk_movement.cc
index 24a517da71..aef29eb04b 100644
--- a/libs/canvas/test/gtk_movement.cc
+++ b/libs/canvas/test/gtk_movement.cc
@@ -69,7 +69,7 @@ int main (int argc, char* argv[])
overall_box.pack_start (scroller);
Gtk::HBox button_box;
-
+
Gtk::Button bigger ("Bigger");
bigger.signal_clicked().connect (sigc::ptr_fun (&bigger_clicked));
button_box.pack_start (bigger);
@@ -85,9 +85,9 @@ int main (int argc, char* argv[])
Gtk::Button right ("Right");
right.signal_clicked().connect (sigc::ptr_fun (&right_clicked));
button_box.pack_start (right);
-
+
overall_box.pack_start (button_box, false, false);
-
+
window.add (overall_box);
canvas.show ();
window.show_all ();
diff --git a/libs/canvas/test/gtk_scene.cc b/libs/canvas/test/gtk_scene.cc
index 95e9b9c299..8e30361d94 100644
--- a/libs/canvas/test/gtk_scene.cc
+++ b/libs/canvas/test/gtk_scene.cc
@@ -26,7 +26,7 @@ int main (int argc, char* argv[])
Gtk::VBox overall_vbox;
Gtk::HScrollbar h_scroll;
Gtk::VScrollbar v_scroll;
-
+
GtkCanvasViewport viewport (*h_scroll.get_adjustment(), *v_scroll.get_adjustment());
GtkCanvas* canvas = viewport.canvas ();
@@ -60,7 +60,7 @@ int main (int argc, char* argv[])
window.add (overall_vbox);
canvas->show ();
window.show_all ();
-
+
Gtk::Main::run (window);
return 0;
}
diff --git a/libs/canvas/test/gtk_viewport.cc b/libs/canvas/test/gtk_viewport.cc
index 90bf819d86..a9c326bc7a 100644
--- a/libs/canvas/test/gtk_viewport.cc
+++ b/libs/canvas/test/gtk_viewport.cc
@@ -37,7 +37,7 @@ int main (int argc, char* argv[])
b.set_outline_color (0x00ff00ff);
Gtk::HBox button_box;
-
+
Gtk::Button left ("Left");
left.signal_clicked().connect (sigc::ptr_fun (&left_clicked));
button_box.pack_start (left);
@@ -48,18 +48,18 @@ int main (int argc, char* argv[])
hadj = new Gtk::Adjustment (0, 0, 1e3);
vadj = new Gtk::Adjustment (0, 0, 1e3);
-
+
Gtk::Viewport viewport (*hadj, *vadj);
viewport.add (canvas);
Gtk::VBox overall_box;
overall_box.pack_start (viewport);
overall_box.pack_start (button_box, false, false);
-
+
window.add (overall_box);
canvas.show ();
window.show_all ();
-
+
Gtk::Main::run (window);
return 0;
}
diff --git a/libs/canvas/test/optimizing_lookup_table.cc b/libs/canvas/test/optimizing_lookup_table.cc
index 8449b26498..6022ff3797 100644
--- a/libs/canvas/test/optimizing_lookup_table.cc
+++ b/libs/canvas/test/optimizing_lookup_table.cc
@@ -23,7 +23,7 @@ OptimizingLookupTableTest::build_1 ()
Rectangle d (canvas.root(), Rect (33, 33, 64, 64));
d.set_outline_width (0);
OptimizingLookupTable table (*canvas.root(), 1);
-
+
CPPUNIT_ASSERT (table._items_per_cell == 1);
CPPUNIT_ASSERT (table._cell_size.x == 32);
CPPUNIT_ASSERT (table._cell_size.y == 32);
@@ -65,10 +65,10 @@ OptimizingLookupTableTest::get_small ()
Rectangle d (canvas.root(), Rect (33, 33, 64, 64));
d.set_outline_width (0);
OptimizingLookupTable table (*canvas.root(), 1);
-
+
vector<Item*> items = table.get (Rect (16, 16, 48, 48));
CPPUNIT_ASSERT (items.size() == 4);
-
+
items = table.get (Rect (32, 32, 33, 33));
CPPUNIT_ASSERT (items.size() == 1);
}
@@ -80,7 +80,7 @@ OptimizingLookupTableTest::get_big ()
double const s = 8;
int const N = 1024;
-
+
for (int x = 0; x < N; ++x) {
for (int y = 0; y < N; ++y) {
Rectangle* r = new Rectangle (canvas.root());
diff --git a/libs/canvas/test/render.cc b/libs/canvas/test/render.cc
index 96bd7eb166..043ed83d41 100644
--- a/libs/canvas/test/render.cc
+++ b/libs/canvas/test/render.cc
@@ -78,7 +78,7 @@ RenderTest::basics ()
text_group.set_position (Duple (128, 64));
Text text (&text_group);
text.set ("Hello world!");
-
+
canvas.render_to_image (Rect (0, 0, 256, 256));
canvas.write_to_png ("render_basics.png");
diff --git a/libs/canvas/test/types.cc b/libs/canvas/test/types.cc
index 69667466de..ba6baef149 100644
--- a/libs/canvas/test/types.cc
+++ b/libs/canvas/test/types.cc
@@ -44,7 +44,7 @@ TypesTest::extend ()
CPPUNIT_ASSERT (c.y1 == 130);
}
}
-
+
void
TypesTest::test_safe_add ()
{
diff --git a/libs/canvas/test/types.h b/libs/canvas/test/types.h
index 3a5c0dac9b..833b234579 100644
--- a/libs/canvas/test/types.h
+++ b/libs/canvas/test/types.h
@@ -15,4 +15,4 @@ public:
void test_safe_add ();
};
-
+
diff --git a/libs/canvas/test/wave_view.cc b/libs/canvas/test/wave_view.cc
index 9b95930cf1..de7118b90c 100644
--- a/libs/canvas/test/wave_view.cc
+++ b/libs/canvas/test/wave_view.cc
@@ -43,7 +43,7 @@ WaveViewTest::setUp ()
AudioEngine engine ("test", "");
MIDI::Manager::create (engine.jack ());
CPPUNIT_ASSERT (engine.start () == 0);
-
+
Session session (engine, "tmp_session", "tmp_session");
engine.set_session (&session);
@@ -70,7 +70,7 @@ void
WaveViewTest::make_canvas ()
{
/* this leaks various things, but hey ho */
-
+
_canvas = new ImageCanvas (Duple (256, 256));
_wave_view = new WaveView (_canvas->root(), _audio_region);
_wave_view->set_frames_per_pixel ((double) (44100 / 1000) / 64);
@@ -84,7 +84,7 @@ WaveViewTest::all ()
gets called once; there are various singletons etc. in Ardour which don't
like being recreated.
*/
-
+
render_all_at_once ();
render_in_pieces ();
cache ();
@@ -94,7 +94,7 @@ void
WaveViewTest::render_all_at_once ()
{
make_canvas ();
-
+
_canvas->render_to_image (Rect (0, 0, 256, 256));
_canvas->write_to_png ("waveview_1.png");
@@ -119,11 +119,11 @@ void
WaveViewTest::cache ()
{
make_canvas ();
-
+
/* Whole of the render area needs caching from scratch */
-
+
_wave_view->invalidate_whole_cache ();
-
+
Rect whole (0, 0, 256, 256);
_canvas->render_to_image (whole);
@@ -132,7 +132,7 @@ WaveViewTest::cache ()
CPPUNIT_ASSERT (_wave_view->_cache.front()->end() == 256);
_wave_view->invalidate_whole_cache ();
-
+
/* Render a bit in the middle */
Rect part1 (128, 0, 196, 256);
@@ -145,11 +145,11 @@ WaveViewTest::cache ()
/* Now render the whole thing and check that the cache sorts itself out */
_canvas->render_to_image (whole);
-
+
CPPUNIT_ASSERT (_wave_view->_cache.size() == 3);
list<WaveView::CacheEntry*>::iterator i = _wave_view->_cache.begin ();
-
+
CPPUNIT_ASSERT ((*i)->start() == 0);
CPPUNIT_ASSERT ((*i)->end() == 128);
++i;
diff --git a/libs/canvas/test/xml.cc b/libs/canvas/test/xml.cc
index ef6871dc76..5bc5dec2b7 100644
--- a/libs/canvas/test/xml.cc
+++ b/libs/canvas/test/xml.cc
@@ -29,7 +29,7 @@ XMLTest::get ()
g.set_position (Duple (64, 72));
Line l (&g);
l.set (Duple (41, 43), Duple (44, 46));
-
+
XMLTree* tree = canvas.get_state ();
tree->write ("test.xml");
diff --git a/libs/canvas/test/xml.h b/libs/canvas/test/xml.h
index fbe606c028..bf905b94bd 100644
--- a/libs/canvas/test/xml.h
+++ b/libs/canvas/test/xml.h
@@ -12,6 +12,6 @@ public:
void get ();
void set ();
-private:
+private:
void check (std::string const &);
};
diff --git a/libs/canvas/text.cc b/libs/canvas/text.cc
index fbf7d7943c..d1f76eb1a3 100644
--- a/libs/canvas/text.cc
+++ b/libs/canvas/text.cc
@@ -71,7 +71,7 @@ void
Text::set (string const & text)
{
begin_change ();
-
+
_text = text;
_need_redraw = true;
@@ -134,7 +134,7 @@ Text::_redraw () const
#else
_image = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, _width, _height);
#endif
-
+
Cairo::RefPtr<Cairo::Context> img_context = Cairo::Context::create (_image);
#ifdef __APPLE__
@@ -142,7 +142,7 @@ Text::_redraw () const
*/
img_context->scale (2, 2);
#endif
-
+
/* and draw, in the appropriate color of course */
if (_outline) {
@@ -173,7 +173,7 @@ Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
Rect self = item_to_window (Rect (0, 0, min (_clamped_width, (double)_image->get_width ()), _image->get_height ()));
boost::optional<Rect> i = self.intersection (area);
-
+
if (!i) {
return;
}
@@ -181,7 +181,7 @@ Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
if (_need_redraw) {
_redraw ();
}
-
+
Rect intersection (i.get());
context->rectangle (intersection.x0, intersection.y0, intersection.width(), intersection.height());
@@ -238,7 +238,7 @@ void
Text::set_alignment (Pango::Alignment alignment)
{
begin_change ();
-
+
_alignment = alignment;
_need_redraw = true;
_bounding_box_dirty = true;
@@ -249,7 +249,7 @@ void
Text::set_font_description (Pango::FontDescription font_description)
{
begin_change ();
-
+
_font_description = new Pango::FontDescription (font_description);
_need_redraw = true;
_width_correction = -1.0;
@@ -272,7 +272,7 @@ Text::set_color (Color color)
end_change ();
}
-
+
void
Text::dump (ostream& o) const
{
diff --git a/libs/canvas/tracking_text.cc b/libs/canvas/tracking_text.cc
index 7f945dc7ce..1b3004b3b1 100644
--- a/libs/canvas/tracking_text.cc
+++ b/libs/canvas/tracking_text.cc
@@ -70,7 +70,7 @@ TrackingText::pointer_motion (Duple const & winpos)
pos = pos.translate (offset);
/* keep inside the window */
-
+
Rect r (0, 0, _canvas->width(), _canvas->height());
/* border of 200 pixels on the right, and 50 on all other sides */
@@ -83,7 +83,7 @@ TrackingText::pointer_motion (Duple const & winpos)
r.y1 = std::max (r.y0, (r.y1 - border));
/* clamp */
-
+
if (pos.x < r.x0) {
pos.x = r.x0;
} else if (pos.x > r.x1) {
diff --git a/libs/canvas/utils.cc b/libs/canvas/utils.cc
index 7b81cf5951..2c8905b331 100644
--- a/libs/canvas/utils.cc
+++ b/libs/canvas/utils.cc
@@ -94,7 +94,7 @@ ArdourCanvas::distance_to_segment_squared (Duple const & p, Duple const & p1, Du
// extending the segment, parameterized as p1 + (t * (p2 - p1)),
// we find projection of point p onto the line.
// It falls where t = [(p - p1) . (p2 - p1)] / |p2 - p1|^2
-
+
t = ((dp1x * dx) + (dp1y * dy)) / segLenSquared;
if (t < kEpsilon) {
diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc
index 7f0aed6dff..fce30e7f38 100644
--- a/libs/canvas/wave_view.cc
+++ b/libs/canvas/wave_view.cc
@@ -274,7 +274,7 @@ WaveView::compute_tips (PeakData const & peak, WaveView::LineTips& tips) const
const double effective_height = _height;
/* remember: canvas (and cairo) coordinate space puts the origin at the upper left.
-
+
So, a sample value of 1.0 (0dbFS) will be computed as:
(1.0 - 1.0) * 0.5 * effective_height
@@ -317,11 +317,11 @@ WaveView::compute_tips (PeakData const & peak, WaveView::LineTips& tips) const
tips.top = center - spread;
tips.bot = center + spread;
}
-
+
tips.top = min (effective_height, max (0.0, tips.top));
tips.bot = min (effective_height, max (0.0, tips.bot));
}
-
+
Coord
WaveView::y_extent (double s) const
@@ -474,7 +474,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak
} else {
p.min = 0.0;
}
-
+
compute_tips (p, tips[i]);
tips[i].spread = tips[i].bot - tips[i].top;
}
@@ -498,7 +498,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak
if (req->should_stop()) {
return;
}
-
+
Color alpha_one = rgba_to_color (0, 0, 0, 1.0);
set_source_rgba (wave_context, alpha_one);
@@ -590,7 +590,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak
wave_context->move_to (i, tips[i].top);
wave_context->line_to (i, tips[i].bot);
}
-
+
/* draw square waves and other discontiguous points clearly */
if (i > 0) {
if (tips[i-1].top + 2 < tips[i].top) {
@@ -678,7 +678,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak
if (req->should_stop()) {
return;
}
-
+
Cairo::RefPtr<Cairo::Context> context = Cairo::Context::create (image);
/* Here we set a source colour and use the various components as a mask. */
@@ -722,7 +722,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak
if (req->should_stop()) {
return;
}
-
+
context->mask (images.wave, 0, 0);
context->fill ();
@@ -756,11 +756,11 @@ WaveView::cache_request_result (boost::shared_ptr<WaveViewThreadRequest> req) co
req->end,
req->image));
images->add (_region->audio_source (_channel), ret);
-
+
/* consolidate cache first (removes fully-contained
* duplicate images)
*/
-
+
images->consolidate_image_cache (_region->audio_source (_channel),
req->channel, req->height, req->amplitude,
req->fill_color, req->samples_per_pixel);
@@ -774,14 +774,14 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
boost::shared_ptr<WaveViewCache::Entry> ret;
full_image = true;
-
+
/* this is called from a ::render() call, when we need an image to
draw with.
*/
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1 needs image from %2 .. %3\n", name, start, end));
-
-
+
+
{
Glib::Threads::Mutex::Lock lmq (request_queue_lock);
@@ -793,7 +793,7 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1 CR %2 stop? %3 image %4\n", this, current_request,
(current_request ? current_request->should_stop() : false),
(current_request ? current_request->image : 0)));
-
+
if (current_request && !current_request->should_stop() && current_request->image) {
/* put the image into the cache so that other
@@ -801,7 +801,7 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
*/
if (current_request->start <= start && current_request->end >= end) {
-
+
ret.reset (new WaveViewCache::Entry (current_request->channel,
current_request->height,
current_request->amplitude,
@@ -810,7 +810,7 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
current_request->start,
current_request->end,
current_request->image));
-
+
cache_request_result (current_request);
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1: got image from completed request, spans %2..%3\n",
name, current_request->start, current_request->end));
@@ -824,21 +824,21 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
if (!ret) {
/* no current image draw request, so look in the cache */
-
+
ret = get_image_from_cache (start, end, full_image);
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1: lookup from cache gave %2 (full %3)\n",
name, ret, full_image));
}
-
-
+
+
if (!ret || !full_image) {
if ((rendered && get_image_in_thread) || always_get_image_in_thread) {
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1: generating image in caller thread\n", name));
-
+
boost::shared_ptr<WaveViewThreadRequest> req (new WaveViewThreadRequest);
req->type = WaveViewThreadRequest::Draw;
@@ -853,7 +853,7 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
req->width = desired_image_width ();
/* draw image in this (the GUI thread) */
-
+
generate_image (req, false);
/* cache the result */
@@ -863,7 +863,7 @@ WaveView::get_image (framepos_t start, framepos_t end, bool& full_image) const
/* reset this so that future missing images are
* generated in a a worker thread.
*/
-
+
get_image_in_thread = false;
} else {
@@ -963,34 +963,34 @@ WaveView::generate_image (boost::shared_ptr<WaveViewThreadRequest> req, bool in_
* width by using an image sample count of the screen width added
* on each side of the desired image center.
*/
-
+
const framepos_t center = req->start + ((req->end - req->start) / 2);
const framecnt_t image_samples = req->width;
-
+
/* we can request data from anywhere in the Source, between 0 and its length
*/
-
+
framepos_t sample_start = max (_region_start, (center - image_samples));
framepos_t sample_end = min (center + image_samples, region_end());
const int n_peaks = llrintf ((sample_end - sample_start)/ (req->samples_per_pixel));
-
+
boost::scoped_array<ARDOUR::PeakData> peaks (new PeakData[n_peaks]);
/* Note that Region::read_peaks() takes a start position based on an
offset into the Region's **SOURCE**, rather than an offset into
the Region itself.
*/
-
+
framecnt_t peaks_read = _region->read_peaks (peaks.get(), n_peaks,
sample_start, sample_end - sample_start,
req->channel,
req->samples_per_pixel);
-
+
req->image = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, n_peaks, req->height);
/* make sure we record the sample positions that were actually used */
req->start = sample_start;
req->end = sample_end;
-
+
if (peaks_read > 0) {
/* region amplitude will have been used to generate the
@@ -998,7 +998,7 @@ WaveView::generate_image (boost::shared_ptr<WaveViewThreadRequest> req, bool in_
* amplitude_above_axis. So apply that here before
* rendering.
*/
-
+
if (_amplitude_above_axis != 1.0) {
for (framecnt_t i = 0; i < n_peaks; ++i) {
peaks[i].max *= _amplitude_above_axis;
@@ -1012,8 +1012,8 @@ WaveView::generate_image (boost::shared_ptr<WaveViewThreadRequest> req, bool in_
}
} else {
cerr << "Request stopped before image generation\n";
- }
-
+ }
+
if (in_render_thread && !req->should_stop()) {
DEBUG_TRACE (DEBUG::WaveView, string_compose ("done with request for %1 at %2 CR %3 req %4 range %5 .. %6\n", this, g_get_monotonic_time(), current_request, req, req->start, req->end));
const_cast<WaveView*>(this)->ImageReady (); /* emit signal */
@@ -1040,7 +1040,7 @@ void
WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
assert (_samples_per_pixel != 0);
-
+
if (!_region) {
return;
}
@@ -1064,11 +1064,11 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
* window coordinates. It begins at zero (in item coordinates for this
* waveview, and extends to region_length() / _samples_per_pixel.
*/
-
+
Rect self = item_to_window (Rect (0.0, 0.0, region_length() / _samples_per_pixel, _height));
// cerr << name << " RENDER " << area << " self = " << self << endl;
-
+
/* Now lets get the intersection with the area we've been asked to draw */
boost::optional<Rect> d = self.intersection (area);
@@ -1082,17 +1082,17 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
/* "draw" is now a rectangle that defines the rectangle we need to
* update/render the waveview into, in window coordinate space.
*/
-
+
/* window coordinates - pixels where x=0 is the left edge of the canvas
* window. We round down in case we were asked to
* draw "between" pixels at the start and/or end.
*/
-
+
double draw_start = floor (draw.x0);
const double draw_end = floor (draw.x1);
// cerr << "Need to draw " << draw_start << " .. " << draw_end << " vs. " << area << " and self = " << self << endl;
-
+
/* image coordnates: pixels where x=0 is the start of this waveview,
* wherever it may be positioned. thus image_start=N means "an image
* that begins N pixels after the start of region that this waveview is
@@ -1101,18 +1101,18 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
const framepos_t image_start = window_to_image (self.x0, draw_start);
const framepos_t image_end = window_to_image (self.x0, draw_end);
-
+
// cerr << "Image/WV space: " << image_start << " .. " << image_end << endl;
-
+
/* sample coordinates - note, these are not subject to rounding error
*
* "sample_start = N" means "the first sample we need to represent is N
* samples after the first sample of the region"
*/
-
+
framepos_t sample_start = _region_start + (image_start * _samples_per_pixel);
framepos_t sample_end = _region_start + (image_end * _samples_per_pixel);
-
+
// cerr << "Sample space: " << sample_start << " .. " << sample_end << " @ " << _samples_per_pixel << " rs = " << _region_start << endl;
/* sample_start and sample_end are bounded by the region
@@ -1121,17 +1121,17 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
*/
sample_end = min (region_end(), sample_end);
-
+
// cerr << debug_name() << " will need image spanning " << sample_start << " .. " << sample_end << " region spans " << _region_start << " .. " << region_end() << endl;
double image_origin_in_self_coordinates;
boost::shared_ptr<WaveViewCache::Entry> image_to_draw;
-
+
Glib::Threads::Mutex::Lock lci (current_image_lock);
if (_current_image) {
/* check it covers the right sample range */
-
+
if (_current_image->start > sample_start || _current_image->end < sample_end) {
/* doesn't cover the area we need ... reset */
_current_image.reset ();
@@ -1150,7 +1150,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
image_to_draw = get_image (sample_start, sample_end, full_image);
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1 image to draw = %2 (full? %3)\n", name, image_to_draw, full_image));
-
+
if (!image_to_draw) {
/* image not currently available. A redraw will be scheduled
when it is ready.
@@ -1171,7 +1171,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
*/
image_origin_in_self_coordinates = (image_to_draw->start - _region_start) / _samples_per_pixel;
-
+
if (_start_shift && (sample_start == _region_start) && (self.x0 == draw.x0)) {
/* we are going to draw the first pixel for this region, but
we may not want this to overlap a border around the
@@ -1181,14 +1181,14 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
//draw_start += _start_shift;
//image_origin_in_self_coordinates += _start_shift;
}
-
+
/* the image may only be a best-effort ... it may not span the entire
* range requested, though it is guaranteed to cover the start. So
* determine how many pixels we can actually draw.
*/
double draw_width;
-
+
if (image_to_draw != _current_image) {
lci.release ();
@@ -1230,7 +1230,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
* will appear. So specifying (10,10) will put the upper left corner of
* the image at (10,10) in user space.
*/
-
+
context->set_source (image_to_draw->image, x, y);
context->fill ();
@@ -1262,7 +1262,7 @@ WaveView::set_height (Distance height)
invalidate_image_cache ();
_height = height;
get_image_in_thread = true;
-
+
_bounding_box_dirty = true;
end_change ();
}
@@ -1468,17 +1468,17 @@ WaveView::cancel_my_render_request () const
/* try to stop any current rendering of the request, or prevent it from
* ever starting up.
*/
-
+
if (current_request) {
current_request->cancel ();
}
-
+
Glib::Threads::Mutex::Lock lm (request_queue_lock);
/* now remove it from the queue and reset our request pointer so that
have no outstanding request (that we know about)
*/
-
+
request_queue.erase (this);
current_request.reset ();
DEBUG_TRACE (DEBUG::WaveView, string_compose ("%1 now has no request %2\n", this));
@@ -1527,7 +1527,7 @@ WaveView::drawing_thread ()
while (run) {
/* remember that we hold the lock at this point, no matter what */
-
+
if (g_atomic_int_get (&drawing_thread_should_quit)) {
break;
}
@@ -1544,7 +1544,7 @@ WaveView::drawing_thread ()
/* remove the request from the queue (remember: the "request"
* is just a pointer to a WaveView object)
*/
-
+
requestor = *(request_queue.begin());
request_queue.erase (request_queue.begin());
@@ -1602,7 +1602,7 @@ WaveViewCache::lookup_image (boost::shared_ptr<ARDOUR::AudioSource> src,
bool& full_coverage)
{
ImageCache::iterator x;
-
+
if ((x = cache_map.find (src)) == cache_map.end ()) {
/* nothing in the cache for this audio source at all */
return boost::shared_ptr<WaveViewCache::Entry> ();
@@ -1611,14 +1611,14 @@ WaveViewCache::lookup_image (boost::shared_ptr<ARDOUR::AudioSource> src,
CacheLine& caches = x->second;
boost::shared_ptr<Entry> best_partial;
framecnt_t max_coverage = 0;
-
+
/* Find a suitable ImageSurface, if it exists.
*/
for (CacheLine::iterator c = caches.begin(); c != caches.end(); ++c) {
boost::shared_ptr<Entry> e (*c);
-
+
if (channel != e->channel
|| height != e->height
|| amplitude != e->amplitude
@@ -1673,7 +1673,7 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr<ARDOUR::AudioSource> s
ImageCache::iterator x;
/* MUST BE CALLED FROM (SINGLE) GUI THREAD */
-
+
if ((x = cache_map.find (src)) == cache_map.end ()) {
return;
}
@@ -1686,7 +1686,7 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr<ARDOUR::AudioSource> s
++nxt;
boost::shared_ptr<Entry> e1 (*c1);
-
+
if (channel != e1->channel
|| height != e1->height
|| amplitude != e1->amplitude
@@ -1696,12 +1696,12 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr<ARDOUR::AudioSource> s
/* doesn't match current properties, ignore and move on
* to the next one.
*/
-
+
other_entries++;
c1 = nxt;
continue;
}
-
+
/* c1 now points to a cached image entry that matches current
* properties. Check all subsequent cached imaged entries to
* see if there are others that also match but represent
@@ -1714,7 +1714,7 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr<ARDOUR::AudioSource> s
++nxt2;
boost::shared_ptr<Entry> e2 (*c2);
-
+
if (e1 == e2 || channel != e2->channel
|| height != e2->height
|| amplitude != e2->amplitude
@@ -1727,7 +1727,7 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr<ARDOUR::AudioSource> s
c2 = nxt2;
continue;
}
-
+
if (e2->start >= e1->start && e2->end <= e1->end) {
/* c2 is fully contained by c1, so delete it */
caches.erase (c2);
@@ -1754,7 +1754,7 @@ void
WaveViewCache::add (boost::shared_ptr<ARDOUR::AudioSource> src, boost::shared_ptr<Entry> ce)
{
/* MUST BE CALLED FROM (SINGLE) GUI THREAD */
-
+
Cairo::RefPtr<Cairo::ImageSurface> img (ce->image);
image_cache_size += img->get_height() * img->get_width () * 4; /* 4 = bytes per FORMAT_ARGB32 pixel */
@@ -1792,7 +1792,7 @@ void
WaveViewCache::cache_flush ()
{
/* Build a sortable list of all cache entries */
-
+
CacheList cache_list;
for (ImageCache::const_iterator cm = cache_map.begin(); cm != cache_map.end(); ++cm) {
@@ -1800,7 +1800,7 @@ WaveViewCache::cache_flush ()
cache_list.push_back (make_pair (cm->first, *cl));
}
}
-
+
/* sort list in LRU order */
SortByTimestamp sorter;
sort (cache_list.begin(), cache_list.end(), sorter);
@@ -1810,32 +1810,32 @@ WaveViewCache::cache_flush ()
ListEntry& le (cache_list.front());
ImageCache::iterator x;
-
+
if ((x = cache_map.find (le.first)) != cache_map.end ()) {
-
+
CacheLine& cl = x->second;
-
+
for (CacheLine::iterator c = cl.begin(); c != cl.end(); ++c) {
-
+
if (*c == le.second) {
DEBUG_TRACE (DEBUG::WaveView, string_compose ("Removing cache line entry for %1\n", x->first->name()));
-
+
/* Remove this entry from this cache line */
cl.erase (c);
-
+
if (cl.empty()) {
/* remove cache line from main cache: no more entries */
cache_map.erase (x);
}
-
+
break;
}
}
-
+
Cairo::RefPtr<Cairo::ImageSurface> img (le.second->image);
uint64_t size = img->get_height() * img->get_width() * 4; /* 4 = bytes per FORMAT_ARGB32 pixel */
-
+
if (image_cache_size > size) {
image_cache_size -= size;
} else {
diff --git a/libs/canvas/xfade_curve.cc b/libs/canvas/xfade_curve.cc
index 259b0e6da5..c8e477697c 100644
--- a/libs/canvas/xfade_curve.cc
+++ b/libs/canvas/xfade_curve.cc
@@ -35,7 +35,7 @@ static const bool show_bg_fades = false;
#else
static const bool show_bg_fades = true;
#endif
-
+
XFadeCurve::XFadeCurve (Canvas* c)
: Item (c)
, points_per_segment (32)
diff --git a/libs/clearlooks-newer/animation.c b/libs/clearlooks-newer/animation.c
index 8339ed7c19..9fd530f201 100644
--- a/libs/clearlooks-newer/animation.c
+++ b/libs/clearlooks-newer/animation.c
@@ -31,7 +31,7 @@
struct _AnimationInfo {
GTimer *timer;
-
+
gdouble start_modifier;
gdouble stop_time;
GtkWidget *widget;
@@ -107,11 +107,11 @@ static void
destroy_animation_info_and_weak_unref (gpointer data)
{
AnimationInfo *animation_info = data;
-
+
/* force a last redraw. This is so that if the animation is removed,
* the widget is left in a sane state. */
force_widget_redraw (animation_info->widget);
-
+
g_object_weak_unref (G_OBJECT (animation_info->widget), on_animated_widget_destruction, data);
animation_info_destroy (animation_info);
}
@@ -122,7 +122,7 @@ lookup_animation_info (const GtkWidget *widget)
{
if (animated_widgets)
return g_hash_table_lookup (animated_widgets, widget);
-
+
return NULL;
}
@@ -131,26 +131,26 @@ static void
add_animation (const GtkWidget *widget, gdouble stop_time)
{
AnimationInfo *value;
-
+
/* object already in the list, do not add it twice */
if (lookup_animation_info (widget))
return;
-
+
if (animated_widgets == NULL)
animated_widgets = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, destroy_animation_info_and_weak_unref);
-
+
value = g_new(AnimationInfo, 1);
-
+
value->widget = (GtkWidget*) widget;
-
+
value->timer = g_timer_new ();
value->stop_time= stop_time;
value->start_modifier = 0.0;
g_object_weak_ref (G_OBJECT (widget), on_animated_widget_destruction, value);
g_hash_table_insert (animated_widgets, (GtkWidget*) widget, value);
-
+
start_timer ();
}
@@ -161,34 +161,34 @@ update_animation_info (gpointer key, gpointer value, gpointer user_data)
{
AnimationInfo *animation_info;
GtkWidget *widget = key;
-
+
animation_info = value;
(void) user_data;
-
+
g_assert ((widget != NULL) && (animation_info != NULL));
-
+
/* remove the widget from the hash table if it is not drawable */
if (!GTK_WIDGET_DRAWABLE (widget))
{
return TRUE;
}
-
+
if (GE_IS_PROGRESS_BAR (widget))
{
gfloat fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (widget));
-
+
/* stop animation for filled/not filled progress bars */
if (fraction <= 0.0 || fraction >= 1.0)
return TRUE;
}
-
+
force_widget_redraw (widget);
-
+
/* stop at stop_time */
if (animation_info->stop_time != 0 &&
g_timer_elapsed (animation_info->timer, NULL) > animation_info->stop_time)
return TRUE;
-
+
return FALSE;
}
@@ -197,21 +197,21 @@ static gboolean
animation_timeout_handler (gpointer data)
{
(void) data;
-
+
/*g_print("** TICK **\n");*/
-
+
/* enter threads as update_animation_info will use gtk/gdk. */
gdk_threads_enter ();
g_hash_table_foreach_remove (animated_widgets, update_animation_info, NULL);
/* leave threads again */
gdk_threads_leave ();
-
+
if(g_hash_table_size(animated_widgets)==0)
{
stop_timer ();
return FALSE;
}
-
+
return TRUE;
}
@@ -220,13 +220,13 @@ on_checkbox_toggle (GtkWidget *widget, gpointer data)
{
AnimationInfo *animation_info;
(void) data;
-
+
animation_info = lookup_animation_info (widget);
-
+
if (animation_info != NULL)
{
gfloat elapsed = g_timer_elapsed (animation_info->timer, NULL);
-
+
animation_info->start_modifier = elapsed - animation_info->start_modifier;
}
else
@@ -239,7 +239,7 @@ static void
on_connected_widget_destruction (gpointer data, GObject *widget)
{
(void) widget;
-
+
connected_widgets = g_slist_remove (connected_widgets, data);
g_free (data);
}
@@ -251,14 +251,14 @@ disconnect_all_signals (void)
while (item != NULL)
{
SignalInfo *signal_info = (SignalInfo*) item->data;
-
+
g_signal_handler_disconnect (signal_info->widget, signal_info->handler_id);
g_object_weak_unref (G_OBJECT (signal_info->widget), on_connected_widget_destruction, signal_info);
g_free (signal_info);
-
+
item = g_slist_next (item);
}
-
+
g_slist_free (connected_widgets);
connected_widgets = NULL;
}
@@ -281,7 +281,7 @@ void
clearlooks_animation_progressbar_add (GtkWidget *progressbar)
{
gdouble fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progressbar));
-
+
if (fraction < 1.0 && fraction > 0.0)
add_animation ((GtkWidget*) progressbar, 0.0);
}
@@ -295,10 +295,10 @@ clearlooks_animation_connect_checkbox (GtkWidget *widget)
if (!g_slist_find_custom (connected_widgets, widget, find_signal_info))
{
SignalInfo * signal_info = g_new (SignalInfo, 1);
-
+
signal_info->widget = widget;
signal_info->handler_id = g_signal_connect ((GObject*)widget, "toggled", G_CALLBACK (on_checkbox_toggle), NULL);
-
+
connected_widgets = g_slist_append (connected_widgets, signal_info);
g_object_weak_ref (G_OBJECT (widget), on_connected_widget_destruction, signal_info);
}
@@ -317,7 +317,7 @@ gdouble
clearlooks_animation_elapsed (gpointer data)
{
AnimationInfo *animation_info = lookup_animation_info (data);
-
+
if (animation_info)
return g_timer_elapsed (animation_info->timer, NULL)
- animation_info->start_modifier;
@@ -330,13 +330,13 @@ void
clearlooks_animation_cleanup (void)
{
disconnect_all_signals ();
-
+
if (animated_widgets != NULL)
{
g_hash_table_destroy (animated_widgets);
animated_widgets = NULL;
}
-
+
stop_timer ();
}
#else /* !HAVE_ANIMATION */
diff --git a/libs/clearlooks-newer/cairo-support.c b/libs/clearlooks-newer/cairo-support.c
index 4b82bb5758..e221a0d8e8 100644
--- a/libs/clearlooks-newer/cairo-support.c
+++ b/libs/clearlooks-newer/cairo-support.c
@@ -34,12 +34,12 @@ ge_hsb_from_color (const CairoColor *color,
}
*brightness = (max + min) / 2;
-
+
if (fabs(max - min) < 0.0001)
{
*hue = 0;
*saturation = 0;
- }
+ }
else
{
if (*brightness <= 0.5)
@@ -81,7 +81,7 @@ ge_color_from_hsb (gdouble hue,
gdouble m1, m2, m3;
if (!color) return;
-
+
if (brightness <= 0.5)
m2 = brightness * (1 + saturation);
else
@@ -93,7 +93,7 @@ ge_color_from_hsb (gdouble hue,
hue_shift[1] = hue;
hue_shift[2] = hue - 120;
- color_shift[0] = color_shift[1] = color_shift[2] = brightness;
+ color_shift[0] = color_shift[1] = color_shift[2] = brightness;
i = (saturation == 0)?3:0;
@@ -114,12 +114,12 @@ ge_color_from_hsb (gdouble hue,
color_shift[i] = m1 + (m2 - m1) * (240 - m3) / 60;
else
color_shift[i] = m1;
- }
+ }
color->r = color_shift[0];
color->g = color_shift[1];
- color->b = color_shift[2];
- color->a = 1.0;
+ color->b = color_shift[2];
+ color->a = 1.0;
}
void
@@ -201,7 +201,7 @@ ge_shade_color(const CairoColor *base, gdouble shade_ratio, CairoColor *composit
saturation = MAX(saturation, 0.0);
ge_color_from_hsb (hue, saturation, brightness, composite);
- composite->a = base->a;
+ composite->a = base->a;
}
void
@@ -219,7 +219,7 @@ ge_saturate_color (const CairoColor *base, gdouble saturate_level, CairoColor *c
saturation = MAX(saturation, 0.0);
ge_color_from_hsb (hue, saturation, brightness, composite);
- composite->a = base->a;
+ composite->a = base->a;
}
void
@@ -261,7 +261,7 @@ ge_cairo_set_color (cairo_t *cr, const CairoColor *color)
{
g_return_if_fail (cr && color);
- cairo_set_source_rgba (cr, color->r, color->g, color->b, color->a);
+ cairo_set_source_rgba (cr, color->r, color->g, color->b, color->a);
}
void
@@ -282,7 +282,7 @@ ge_cairo_pattern_add_color_stop_color (cairo_pattern_t *pattern,
{
g_return_if_fail (pattern && color);
- cairo_pattern_add_color_stop_rgba (pattern, offset, color->r, color->g, color->b, color->a);
+ cairo_pattern_add_color_stop_rgba (pattern, offset, color->r, color->g, color->b, color->a);
}
void
@@ -302,7 +302,7 @@ ge_cairo_pattern_add_color_stop_shade(cairo_pattern_t *pattern,
ge_shade_color(color, shade, &shaded);
}
- ge_cairo_pattern_add_color_stop_color(pattern, offset, &shaded);
+ ge_cairo_pattern_add_color_stop_color(pattern, offset, &shaded);
}
/* This function will draw a rounded corner at position x,y. If the radius
@@ -370,22 +370,22 @@ ge_cairo_rounded_rectangle (cairo_t *cr,
cairo_move_to (cr, x+radius, y);
else
cairo_move_to (cr, x, y);
-
+
if (corners & CR_CORNER_TOPRIGHT)
cairo_arc (cr, x+w-radius, y+radius, radius, G_PI * 1.5, G_PI * 2);
else
cairo_line_to (cr, x+w, y);
-
+
if (corners & CR_CORNER_BOTTOMRIGHT)
cairo_arc (cr, x+w-radius, y+h-radius, radius, 0, G_PI * 0.5);
else
cairo_line_to (cr, x+w, y+h);
-
+
if (corners & CR_CORNER_BOTTOMLEFT)
cairo_arc (cr, x+radius, y+h-radius, radius, G_PI * 0.5, G_PI);
else
cairo_line_to (cr, x, y+h);
-
+
if (corners & CR_CORNER_TOPLEFT)
cairo_arc (cr, x+radius, y+radius, radius, G_PI, G_PI * 1.5);
else
@@ -425,7 +425,7 @@ ge_cairo_simple_border (cairo_t *cr,
g_return_if_fail (cr != NULL);
g_return_if_fail (tl != NULL);
g_return_if_fail (br != NULL);
-
+
solid_color = (tl == br) || ((tl->r == br->r) && (tl->g == br->g) && (tl->b == br->b) && (tl->a == br->a));
@@ -437,16 +437,16 @@ ge_cairo_simple_border (cairo_t *cr,
if (topleft_overlap)
{
- ge_cairo_set_color(cr, br);
+ ge_cairo_set_color(cr, br);
cairo_move_to(cr, x + 0.5, y + height - 0.5);
cairo_line_to(cr, x + width - 0.5, y + height - 0.5);
cairo_line_to(cr, x + width - 0.5, y + 0.5);
-
+
cairo_stroke (cr);
}
- ge_cairo_set_color(cr, tl);
+ ge_cairo_set_color(cr, tl);
cairo_move_to(cr, x + 0.5, y + height - 0.5);
cairo_line_to(cr, x + 0.5, y + 0.5);
@@ -457,7 +457,7 @@ ge_cairo_simple_border (cairo_t *cr,
if (!solid_color)
{
cairo_stroke(cr);
- ge_cairo_set_color(cr, br);
+ ge_cairo_set_color(cr, br);
}
cairo_move_to(cr, x + 0.5, y + height - 0.5);
@@ -479,7 +479,7 @@ void ge_cairo_polygon (cairo_t *cr,
cairo_save(cr);
- ge_cairo_set_color(cr, color);
+ ge_cairo_set_color(cr, color);
cairo_move_to(cr, points[0].x, points[0].y);
for (i = 1; i < npoints; i++)
@@ -490,7 +490,7 @@ void ge_cairo_polygon (cairo_t *cr,
cairo_line_to(cr, points[i].x, points[i].y);
}
}
-
+
if ((points[npoints-1].x != points[0].x) ||
(points[npoints-1].y != points[0].y))
{
@@ -511,7 +511,7 @@ void ge_cairo_line (cairo_t *cr,
{
cairo_save(cr);
- ge_cairo_set_color(cr, color);
+ ge_cairo_set_color(cr, color);
cairo_set_line_width (cr, 1);
cairo_move_to(cr, x1 + 0.5, y1 + 0.5);
@@ -531,13 +531,13 @@ ge_cairo_mirror (cairo_t *cr,
gint *height)
{
cairo_matrix_t matrix;
-
+
cairo_matrix_init_identity (&matrix);
-
+
cairo_translate (cr, *x, *y);
*x = 0;
*y = 0;
-
+
if (mirror & CR_MIRROR_HORIZONTAL)
{
cairo_matrix_scale (&matrix, -1, 1);
@@ -566,7 +566,7 @@ ge_cairo_exchange_axis (cairo_t *cr,
cairo_matrix_init (&matrix, 0, 1, 1, 0, 0, 0);
cairo_transform (cr, &matrix);
-
+
/* swap width/height */
tmp = *width;
*x = 0;
@@ -658,7 +658,7 @@ ge_cairo_pattern_fill(cairo_t *canvas,
***********************************************/
CairoPattern*
ge_cairo_color_pattern(CairoColor *base)
-{
+{
CairoPattern * result = g_new0(CairoPattern, 1);
#if ((CAIRO_VERSION_MAJOR < 1) || ((CAIRO_VERSION_MAJOR == 1) && (CAIRO_VERSION_MINOR < 2)))
@@ -674,7 +674,7 @@ ge_cairo_color_pattern(CairoColor *base)
base->a);
result->operator = CAIRO_OPERATOR_SOURCE;
-
+
return result;
}
@@ -685,7 +685,7 @@ ge_cairo_color_pattern(CairoColor *base)
***********************************************/
CairoPattern*
ge_cairo_pixbuf_pattern(GdkPixbuf *pixbuf)
-{
+{
CairoPattern * result = g_new0(CairoPattern, 1);
cairo_t *canvas;
@@ -701,7 +701,7 @@ ge_cairo_pixbuf_pattern(GdkPixbuf *pixbuf)
width = gdk_pixbuf_get_width(pixbuf);
height = gdk_pixbuf_get_height(pixbuf);
-
+
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
canvas = cairo_create(surface);
@@ -728,7 +728,7 @@ ge_cairo_pixbuf_pattern(GdkPixbuf *pixbuf)
***********************************************/
CairoPattern*
ge_cairo_pixmap_pattern(GdkPixmap *pixmap)
-{
+{
CairoPattern * result = NULL;
GdkPixbuf * pixbuf;
@@ -741,7 +741,7 @@ ge_cairo_pixmap_pattern(GdkPixmap *pixmap)
0, 0, 0, 0, width, height);
result = ge_cairo_pixbuf_pattern(pixbuf);
-
+
g_object_unref (pixbuf);
return result;
@@ -762,7 +762,7 @@ ge_cairo_linear_shade_gradient_pattern(CairoColor *base,
gboolean vertical)
{
CairoPattern * result = g_new0(CairoPattern, 1);
-
+
#if ((CAIRO_VERSION_MAJOR < 1) || ((CAIRO_VERSION_MAJOR == 1) && (CAIRO_VERSION_MINOR < 2)))
result->type = CAIRO_PATTERN_TYPE_LINEAR;
#endif
@@ -796,7 +796,7 @@ ge_cairo_pattern_destroy(CairoPattern *pattern)
{
if (pattern->handle)
cairo_pattern_destroy(pattern->handle);
-
+
g_free(pattern);
}
}
@@ -810,7 +810,7 @@ const gchar*
g_module_check_init (GModule *module)
{
(void) module;
-
+
return gtk_check_version (GTK_MAJOR_VERSION,
GTK_MINOR_VERSION,
GTK_MICRO_VERSION - GTK_INTERFACE_AGE);
diff --git a/libs/clearlooks-newer/clearlooks_draw.c b/libs/clearlooks-newer/clearlooks_draw.c
index 29803a2d71..bf01a002a4 100644
--- a/libs/clearlooks-newer/clearlooks_draw.c
+++ b/libs/clearlooks-newer/clearlooks_draw.c
@@ -104,9 +104,9 @@ clearlooks_draw_shadow (cairo_t *cr, const ClearlooksColors *colors, gfloat radi
ge_shade_color (&colors->shade[6], 0.92, &shadow);
cairo_set_line_width (cr, 1.0);
-
+
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.1);
-
+
cairo_move_to (cr, width, radius);
ge_cairo_rounded_corner (cr, width, height, radius, CR_CORNER_BOTTOMRIGHT);
cairo_line_to (cr, radius, height);
@@ -156,42 +156,42 @@ clearlooks_draw_highlight_and_shade (cairo_t *cr, const ClearlooksColors *colors
width -= 3;
height -= 3;
-
+
cairo_save (cr);
-
+
/* Top/Left highlight */
if (corners & CR_CORNER_BOTTOMLEFT)
cairo_move_to (cr, x, y+height-radius);
else
cairo_move_to (cr, x, y+height);
-
+
ge_cairo_rounded_corner (cr, x, y, radius, corners & CR_CORNER_TOPLEFT);
if (corners & CR_CORNER_TOPRIGHT)
cairo_line_to (cr, x+width-radius, y);
else
cairo_line_to (cr, x+width, y);
-
+
if (params->shadow & CL_SHADOW_OUT)
ge_cairo_set_color (cr, &hilight);
else
ge_cairo_set_color (cr, &shadow);
-
+
cairo_stroke (cr);
-
+
/* Bottom/Right highlight -- this includes the corners */
cairo_move_to (cr, x+width-radius, y); /* topright and by radius to the left */
ge_cairo_rounded_corner (cr, x+width, y, radius, corners & CR_CORNER_TOPRIGHT);
ge_cairo_rounded_corner (cr, x+width, y+height, radius, corners & CR_CORNER_BOTTOMRIGHT);
ge_cairo_rounded_corner (cr, x, y+height, radius, corners & CR_CORNER_BOTTOMLEFT);
-
+
if (params->shadow & CL_SHADOW_OUT)
ge_cairo_set_color (cr, &shadow);
else
ge_cairo_set_color (cr, &hilight);
-
+
cairo_stroke (cr);
-
+
cairo_restore (cr);
}
@@ -206,7 +206,7 @@ clearlooks_set_border_gradient (cairo_t *cr, const CairoColor *color, double hil
pattern = cairo_pattern_create_linear (0, 0, width, height);
cairo_pattern_add_color_stop_rgb (pattern, 0, color->r, color->g, color->b);
cairo_pattern_add_color_stop_rgb (pattern, 1, bottom_shade.r, bottom_shade.g, bottom_shade.b);
-
+
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}
@@ -229,7 +229,7 @@ clearlooks_draw_gripdots (cairo_t *cr, const ClearlooksColors *colors, int x, in
{
xoff = x -(xr * 3 / 2) + 3 * i;
yoff = y -(yr * 3 / 2) + 3 * j;
-
+
cairo_rectangle (cr, width/2+0.5+xoff, height/2+0.5+yoff, 2, 2);
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.8+contrast);
cairo_fill (cr);
@@ -254,9 +254,9 @@ clearlooks_draw_button (cairo_t *cr,
CairoColor shadow;
ge_shade_color (border_normal, 0.925, &shadow);
-
+
cairo_save (cr);
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
@@ -275,23 +275,23 @@ clearlooks_draw_button (cairo_t *cr,
cairo_translate (cr, 0.5, 0.5);
params->style_functions->draw_inset (cr, &params->parentbg, 0, 0, width-1, height-1, radius+1, params->corners);
cairo_translate (cr, -0.5, -0.5);
- }
-
+ }
+
ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1,
width-(xoffset*2)-2,
height-(yoffset*2)-2,
radius, params->corners);
-
+
if (!params->active)
{
cairo_pattern_t *pattern;
gdouble shade_size = ((100.0/height)*8.0)/100.0;
CairoColor top_shade, bottom_shade, middle_shade;
-
+
ge_shade_color (fill, 1.1, &top_shade);
ge_shade_color (fill, 0.98, &middle_shade);
ge_shade_color (fill, 0.93, &bottom_shade);
-
+
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, top_shade.r, top_shade.g, top_shade.b);
cairo_pattern_add_color_stop_rgb (pattern, shade_size, fill->r, fill->g, fill->b);
@@ -307,7 +307,7 @@ clearlooks_draw_button (cairo_t *cr,
else
{
cairo_pattern_t *pattern;
-
+
ge_cairo_set_color (cr, fill);
cairo_fill_preserve (cr);
@@ -346,7 +346,7 @@ clearlooks_draw_button (cairo_t *cr,
ge_cairo_set_color (cr, d);
ge_cairo_stroke_rectangle (cr, 3.5, 3.5, width-7, height-7);
}
-
+
ge_cairo_rounded_rectangle (cr, xoffset + 0.5, yoffset + 0.5, width-(xoffset*2)-1, height-(yoffset*2)-1, radius, params->corners);
if (params->disabled)
@@ -356,9 +356,9 @@ clearlooks_draw_button (cairo_t *cr,
clearlooks_set_border_gradient (cr, border_normal, 1.32, 0, height);
else
ge_cairo_set_color (cr, border_normal);
-
+
cairo_stroke (cr);
-
+
/* Draw the "shadow" */
if (!params->active)
{
@@ -368,7 +368,7 @@ clearlooks_draw_button (cairo_t *cr,
cairo_line_to (cr, width-params->xthickness, height - params->ythickness - 1);
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.1);
cairo_stroke (cr);
-
+
/* Draw topleft shadow */
clearlooks_draw_top_left_highlight (cr, fill, params, width, height, radius);
}
@@ -384,13 +384,13 @@ clearlooks_draw_entry (cairo_t *cr,
const CairoColor *base = &colors->base[params->state_type];
CairoColor border = colors->shade[params->disabled ? 4 : 6];
double radius = MIN (params->radius, MIN ((width - 4.0) / 2.0, (height - 4.0) / 2.0));
-
+
if (params->focus)
border = colors->spot[2];
cairo_translate (cr, x+0.5, y+0.5);
cairo_set_line_width (cr, 1.0);
-
+
/* Fill the background (shouldn't have to) */
cairo_rectangle (cr, -0.5, -0.5, width, height);
ge_cairo_set_color (cr, &params->parentbg);
@@ -400,7 +400,7 @@ clearlooks_draw_entry (cairo_t *cr,
cairo_rectangle (cr, 1.5, 1.5, width-4, height-4);
ge_cairo_set_color (cr, base);
cairo_fill (cr);
-
+
params->style_functions->draw_inset (cr, &params->parentbg, 0, 0, width-1, height-1, radius+1, params->corners);
/* Draw the inner shadow */
@@ -472,20 +472,20 @@ clearlooks_draw_spinbutton_down (cairo_t *cr,
ge_shade_color (&colors->bg[GTK_STATE_NORMAL], 0.8, &shadow);
cairo_translate (cr, x+1, y+1);
-
+
ge_cairo_rounded_rectangle (cr, 1, 1, width-4, height-4, radius, params->corners);
-
+
ge_cairo_set_color (cr, &colors->bg[params->state_type]);
-
+
cairo_fill_preserve (cr);
-
+
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, shadow.r, shadow.g, shadow.b);
cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.0);
-
+
cairo_set_source (cr, pattern);
cairo_fill (cr);
-
+
cairo_pattern_destroy (pattern);
}
@@ -503,13 +503,13 @@ clearlooks_scale_draw_gradient (cairo_t *cr,
cairo_pattern_add_color_stop_rgb (pattern, 0.0, c1->r, c1->g, c1->b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, c2->r, c2->g, c2->b);
- cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1);
+ cairo_rectangle (cr, x+0.5, y+0.5, width-1, height-1);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
ge_cairo_set_color (cr, c3);
- ge_cairo_stroke_rectangle (cr, x, y, width, height);
+ ge_cairo_stroke_rectangle (cr, x, y, width, height);
}
#define TROUGH_SIZE 6
@@ -527,7 +527,7 @@ clearlooks_draw_scale_trough (cairo_t *cr,
{
trough_width = width-3;
trough_height = TROUGH_SIZE-2;
-
+
translate_x = x + 0.5;
translate_y = y + 0.5 + (height/2) - (TROUGH_SIZE/2);
}
@@ -535,19 +535,19 @@ clearlooks_draw_scale_trough (cairo_t *cr,
{
trough_width = TROUGH_SIZE-2;
trough_height = height-3;
-
+
translate_x = x + 0.5 + (width/2) - (TROUGH_SIZE/2);
translate_y = y + 0.5;
}
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, translate_x, translate_y);
-
+
if (!slider->fill_level)
params->style_functions->draw_inset (cr, &params->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
-
+
cairo_translate (cr, 1, 1);
-
+
if (!slider->lower && ! slider->fill_level)
clearlooks_scale_draw_gradient (cr, &colors->shade[3], /* top */
&colors->shade[2], /* bottom */
@@ -575,7 +575,7 @@ clearlooks_draw_slider (cairo_t *cr,
cairo_pattern_t *pattern;
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
if (params->prelight)
@@ -619,7 +619,7 @@ clearlooks_draw_slider (cairo_t *cr,
if (params->prelight)
{
CairoColor highlight;
- ge_shade_color (spot, 1.5, &highlight);
+ ge_shade_color (spot, 1.5, &highlight);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, highlight.r, highlight.g, highlight.b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, spot->r, spot->g, spot->b);
cairo_set_source (cr, pattern);
@@ -650,10 +650,10 @@ clearlooks_draw_slider (cairo_t *cr,
{
cairo_move_to (cr, 6, 0.5);
cairo_line_to (cr, 6, height-1);
-
+
cairo_move_to (cr, width-7, 0.5);
cairo_line_to (cr, width-7, height-1);
-
+
cairo_set_line_width (cr, 1.0);
cairo_set_source_rgba (cr, border->r,
border->g,
@@ -672,7 +672,7 @@ clearlooks_draw_slider_button (cairo_t *cr,
{
double radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
cairo_set_line_width (cr, 1.0);
-
+
if (!slider->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
cairo_translate (cr, x+0.5, y+0.5);
@@ -694,15 +694,15 @@ clearlooks_draw_progressbar_trough (cairo_t *cr,
CairoColor shadow;
cairo_pattern_t *pattern;
double radius = MIN (params->radius, MIN ((height-2.0) / 2.0, (width-2.0) / 2.0));
-
+
cairo_save (cr);
cairo_set_line_width (cr, 1.0);
-
+
/* Fill with bg color */
ge_cairo_set_color (cr, &colors->bg[params->state_type]);
-
- cairo_rectangle (cr, x, y, width, height);
+
+ cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
/* Create trough box */
@@ -724,8 +724,8 @@ clearlooks_draw_progressbar_trough (cairo_t *cr,
/* Top shadow */
cairo_rectangle (cr, x+1, y+1, width-2, 4);
pattern = cairo_pattern_create_linear (x, y, x, y+4);
- cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.3);
- cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.);
+ cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.3);
+ cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
@@ -733,8 +733,8 @@ clearlooks_draw_progressbar_trough (cairo_t *cr,
/* Left shadow */
cairo_rectangle (cr, x+1, y+1, 4, height-2);
pattern = cairo_pattern_create_linear (x, y, x+4, y);
- cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.3);
- cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.);
+ cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.3);
+ cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
@@ -776,7 +776,7 @@ clearlooks_draw_progressbar_fill (cairo_t *cr,
stroke_width = height*2;
x_step = (((float)stroke_width/10)*offset); /* This looks weird ... */
-
+
cairo_translate (cr, x, y);
cairo_save (cr);
@@ -804,16 +804,16 @@ clearlooks_draw_progressbar_fill (cairo_t *cr,
cairo_line_to (cr, stroke_width-x_step, 0);
cairo_line_to (cr, stroke_width/2-x_step, height);
cairo_line_to (cr, -x_step, height);
-
+
cairo_translate (cr, stroke_width, 0);
tile_pos += stroke_width;
}
-
+
cairo_set_source_rgba (cr, colors->spot[2].r,
colors->spot[2].g,
colors->spot[2].b,
0.15);
-
+
cairo_fill (cr);
cairo_restore (cr); /* rounded clip region */
@@ -893,7 +893,7 @@ clearlooks_draw_progressbar_fill (cairo_t *cr,
ge_cairo_set_color (cr, &shadow);
cairo_stroke (cr);
}
-
+
cairo_restore (cr);
cairo_restore (cr); /* rotation, mirroring */
@@ -908,9 +908,9 @@ clearlooks_draw_optionmenu (cairo_t *cr,
{
SeparatorParameters separator;
int offset = params->ythickness + 1;
-
+
params->style_functions->draw_button (cr, colors, params, x, y, width, height);
-
+
separator.horizontal = FALSE;
params->style_functions->draw_separator (cr, colors, params, &separator, x+optionmenu->linepos, y + offset, 2, height - offset*2);
}
@@ -923,7 +923,7 @@ clearlooks_draw_menu_item_separator (cairo_t *cr,
int x, int y, int width, int height)
{
(void) widget;
-
+
cairo_save (cr);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
ge_cairo_set_color (cr, &colors->shade[5]);
@@ -979,10 +979,10 @@ clearlooks_draw_menubar2 (cairo_t *cr,
(void) menubar;
ge_shade_color (&colors->bg[0], 0.96, &lower);
-
+
cairo_translate (cr, x, y);
cairo_rectangle (cr, 0, 0, width, height);
-
+
/* Draw the gradient */
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, colors->bg[0].r,
@@ -994,7 +994,7 @@ clearlooks_draw_menubar2 (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw bottom line */
cairo_set_line_width (cr, 1.0);
cairo_move_to (cr, 0, height-0.5);
@@ -1049,7 +1049,7 @@ clearlooks_get_frame_gap_clip (int x, int y, int width, int height,
{
(void) x;
(void) y;
-
+
if (frame->gap_side == CL_GAP_TOP)
{
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + frame->gap_x, -0.5,
@@ -1062,21 +1062,21 @@ clearlooks_get_frame_gap_clip (int x, int y, int width, int height,
CLEARLOOKS_RECTANGLE_SET ((*bevel), 1.5 + frame->gap_x, height - 2.5,
frame->gap_width - 3, 2.0);
CLEARLOOKS_RECTANGLE_SET ((*border), 0.5 + frame->gap_x, height - 1.5,
- frame->gap_width - 2, 2.0);
+ frame->gap_width - 2, 2.0);
}
else if (frame->gap_side == CL_GAP_LEFT)
{
CLEARLOOKS_RECTANGLE_SET ((*bevel), -0.5, 1.5 + frame->gap_x,
2.0, frame->gap_width - 3);
CLEARLOOKS_RECTANGLE_SET ((*border), -0.5, 0.5 + frame->gap_x,
- 1.0, frame->gap_width - 2);
+ 1.0, frame->gap_width - 2);
}
else if (frame->gap_side == CL_GAP_RIGHT)
{
CLEARLOOKS_RECTANGLE_SET ((*bevel), width - 2.5, 1.5 + frame->gap_x,
2.0, frame->gap_width - 3);
CLEARLOOKS_RECTANGLE_SET ((*border), width - 1.5, 0.5 + frame->gap_x,
- 1.0, frame->gap_width - 2);
+ 1.0, frame->gap_width - 2);
}
}
@@ -1095,7 +1095,7 @@ clearlooks_draw_frame (cairo_t *cr,
CairoColor hilight;
ge_shade_color (&colors->bg[GTK_STATE_NORMAL], 1.05, &hilight);
-
+
if (frame->shadow == CL_SHADOW_NONE) {
const CairoColor *bg = &colors->bg[params->state_type];
ge_cairo_set_color (cr, bg);
@@ -1104,14 +1104,14 @@ clearlooks_draw_frame (cairo_t *cr,
cairo_stroke (cr);
return;
}
-
+
if (frame->gap_x != -1)
clearlooks_get_frame_gap_clip (x, y, width, height,
frame, &bevel_clip, &frame_clip);
-
+
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y+0.5);
-
+
/* save everything */
cairo_save (cr);
/* Set clip for the bevel */
@@ -1123,7 +1123,7 @@ clearlooks_draw_frame (cairo_t *cr,
cairo_rectangle (cr, bevel_clip.x, bevel_clip.y, bevel_clip.width, bevel_clip.height);
cairo_clip (cr);
}
-
+
/* Draw the bevel */
if (frame->shadow == CL_SHADOW_ETCHED_IN || frame->shadow == CL_SHADOW_ETCHED_OUT)
{
@@ -1141,7 +1141,7 @@ clearlooks_draw_frame (cairo_t *cr,
shadow.shadow = frame->shadow;
clearlooks_draw_highlight_and_shade (cr, colors, &shadow, width, height, 0);
}
-
+
/* restore the previous clip region */
cairo_restore (cr);
cairo_save (cr);
@@ -1188,7 +1188,7 @@ clearlooks_draw_tab (cairo_t *cr,
CairoColor hilight;
cairo_pattern_t *pattern;
-
+
double radius;
double strip_size;
@@ -1199,7 +1199,7 @@ clearlooks_draw_tab (cairo_t *cr,
cairo_clip (cr);
cairo_new_path (cr);
- /* Translate and set line width */
+ /* Translate and set line width */
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y+0.5);
@@ -1210,7 +1210,7 @@ clearlooks_draw_tab (cairo_t *cr,
{
height += 3.0;
strip_size = 2.0/height; /* 2 pixel high strip */
-
+
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
}
@@ -1218,18 +1218,18 @@ clearlooks_draw_tab (cairo_t *cr,
{
width += 3.0;
strip_size = 2.0/width;
-
+
if (tab->gap_side == CL_GAP_LEFT)
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
}
-
+
/* Set the fill color */
fill = &colors->bg[params->state_type];
/* Set tab shape */
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1,
radius, params->corners);
-
+
/* Draw fill */
ge_cairo_set_color (cr, fill);
cairo_fill (cr);
@@ -1241,15 +1241,15 @@ clearlooks_draw_tab (cairo_t *cr,
if (!params->active)
{
ShadowParameters shadow;
-
+
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = params->corners;
-
+
clearlooks_draw_highlight_and_shade (cr, colors, &shadow,
width,
height, radius);
}
-
+
if (params->active)
{
@@ -1260,7 +1260,7 @@ clearlooks_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_BOTTOM ? height : 0 );
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
ge_shade_color (fill, 0.92, &shadow);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, hilight.r, hilight.g, hilight.b, 0.4);
@@ -1278,9 +1278,9 @@ clearlooks_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_TOP ? height-2 : 0,
tab->gap_side == CL_GAP_RIGHT ? width : 0,
tab->gap_side == CL_GAP_BOTTOM ? height : 0 );
-
+
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_fill->r, stripe_fill->g, stripe_fill->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_fill->r, stripe_fill->g, stripe_fill->b);
@@ -1292,7 +1292,7 @@ clearlooks_draw_tab (cairo_t *cr,
}
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
if (params->active)
{
ge_cairo_set_color (cr, border2);
@@ -1304,7 +1304,7 @@ clearlooks_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_TOP ? height-2 : 2,
tab->gap_side == CL_GAP_RIGHT ? width : 2,
tab->gap_side == CL_GAP_BOTTOM ? height : 2 );
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, border1->r, border1->g, border1->b);
@@ -1335,12 +1335,12 @@ clearlooks_draw_separator (cairo_t *cr,
{
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y+0.5);
-
+
cairo_move_to (cr, 0.0, 0.0);
cairo_line_to (cr, width, 0.0);
ge_cairo_set_color (cr, &color);
cairo_stroke (cr);
-
+
cairo_move_to (cr, 0.0, 1.0);
cairo_line_to (cr, width, 1.0);
ge_cairo_set_color (cr, &hilight);
@@ -1350,12 +1350,12 @@ clearlooks_draw_separator (cairo_t *cr,
{
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y);
-
+
cairo_move_to (cr, 0.0, 0.0);
cairo_line_to (cr, 0.0, height);
ge_cairo_set_color (cr, &color);
cairo_stroke (cr);
-
+
cairo_move_to (cr, 1.0, 0.0);
cairo_line_to (cr, 1.0, height);
ge_cairo_set_color (cr, &hilight);
@@ -1377,12 +1377,12 @@ clearlooks_draw_list_view_header (cairo_t *cr,
CairoColor hilight;
CairoColor shadow;
- ge_shade_color (border, 1.5, &hilight);
- ge_shade_color (border, 0.925, &shadow);
+ ge_shade_color (border, 1.5, &hilight);
+ ge_shade_color (border, 0.925, &shadow);
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
-
+
/* Draw highlight */
if (header->order == CL_ORDER_FIRST)
{
@@ -1391,19 +1391,19 @@ clearlooks_draw_list_view_header (cairo_t *cr,
}
else
cairo_move_to (cr, 0.0, 0.5);
-
+
cairo_line_to (cr, width, 0.5);
-
+
ge_cairo_set_color (cr, &hilight);
cairo_stroke (cr);
-
+
/* Draw bottom border */
cairo_move_to (cr, 0.0, height-0.5);
cairo_line_to (cr, width, height-0.5);
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
- /* Draw bottom shade */
+ /* Draw bottom shade */
pattern = cairo_pattern_create_linear (0.0, height-5.0, 0.0, height-1.0);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.0);
cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.3);
@@ -1412,14 +1412,14 @@ clearlooks_draw_list_view_header (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw resize grip */
if ((params->ltr && header->order != CL_ORDER_LAST) ||
(!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
{
SeparatorParameters separator;
separator.horizontal = FALSE;
-
+
if (params->ltr)
params->style_functions->draw_separator (cr, colors, params, &separator,
width-1.5, 4.0, 2, height-8.0);
@@ -1445,7 +1445,7 @@ clearlooks_draw_toolbar (cairo_t *cr,
(void) widget;
dark = &colors->shade[3];
ge_shade_color (fill, 1.1, &light);
-
+
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
@@ -1507,10 +1507,10 @@ clearlooks_draw_menubaritem (cairo_t *cr,
CairoColor fill_shade;
CairoColor border = colors->spot[2];
cairo_pattern_t *pattern;
-
+
ge_shade_color (&border, 1.05, &border);
ge_shade_color (fill, 0.85, &fill_shade);
-
+
cairo_set_line_width (cr, 1.0);
ge_cairo_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1, height, widget->radius, widget->corners);
@@ -1537,7 +1537,7 @@ clearlooks_draw_selected_cell (cairo_t *cr,
CairoColor border;
cairo_pattern_t *pattern;
cairo_save (cr);
-
+
cairo_translate (cr, x, y);
if (params->focus)
@@ -1560,8 +1560,8 @@ clearlooks_draw_selected_cell (cairo_t *cr,
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
- ge_shade_color(&upper_color, 0.8, &border);
+
+ ge_shade_color(&upper_color, 0.8, &border);
cairo_move_to (cr, 0, 0.5);
cairo_rel_line_to (cr, width, 0);
@@ -1586,18 +1586,18 @@ clearlooks_draw_scrollbar_trough (cairo_t *cr,
CairoColor bg_shade;
cairo_pattern_t *pattern;
const CairoColor *border = &colors->shade[5];
-
+
(void) widget;
bg = &colors->shade[2];
ge_shade_color (bg, 0.95, &bg_shade);
-
+
cairo_set_line_width (cr, 1);
/* cairo_translate (cr, x, y); */
-
+
if (scrollbar->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
- cairo_translate (cr, x, y);
+ cairo_translate (cr, x, y);
/* Draw fill */
cairo_rectangle (cr, 1, 0, width-2, height);
@@ -1607,12 +1607,12 @@ clearlooks_draw_scrollbar_trough (cairo_t *cr,
/* Draw shadow */
pattern = cairo_pattern_create_linear (1, 0, 3, 0);
cairo_pattern_add_color_stop_rgb (pattern, 0, bg_shade.r, bg_shade.g, bg_shade.b);
- cairo_pattern_add_color_stop_rgb (pattern, 1.0, bg->r, bg->g, bg->b);
+ cairo_pattern_add_color_stop_rgb (pattern, 1.0, bg->r, bg->g, bg->b);
cairo_rectangle (cr, 1, 0, 4, height);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw border */
ge_cairo_set_color (cr, border);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
@@ -1633,7 +1633,7 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
ge_shade_color(&colors->shade[6], 1.05, &border);
-
+
if (scrollbar->horizontal)
{
if (stepper->stepper == CL_STEPPER_A)
@@ -1648,22 +1648,22 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
else if (stepper->stepper == CL_STEPPER_D)
corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
}
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius, corners);
-
+
if (scrollbar->horizontal)
pattern = cairo_pattern_create_linear (0, 0, 0, height);
else
pattern = cairo_pattern_create_linear (0, 0, width, 0);
-
+
s2 = colors->bg[widget->state_type];
ge_shade_color(&s2, 1.06, &s1);
ge_shade_color(&s2, 0.98, &s3);
ge_shade_color(&s2, 0.94, &s4);
-
+
cairo_pattern_add_color_stop_rgb(pattern, 0, s1.r, s1.g, s1.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, s2.r, s2.g, s2.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.7, s3.r, s3.g, s3.b);
@@ -1671,15 +1671,15 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_translate (cr, 0.5, 0.5);
clearlooks_draw_top_left_highlight (cr, &s2, widget, width, height, (stepper->stepper == CL_STEPPER_A) ? radius : 0);
cairo_translate (cr, -0.5, -0.5);
-
+
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, corners);
clearlooks_set_border_gradient (cr, &border, 1.2, (scrollbar->horizontal ? 0 : width), (scrollbar->horizontal ? height: 0));
cairo_stroke (cr);
-
+
cairo_translate (cr, 0.5, 0.5);
}
@@ -1710,11 +1710,11 @@ clearlooks_draw_scrollbar_slider (cairo_t *cr,
else
height += 1;
}
-
+
if (!scrollbar->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
- cairo_translate (cr, x, y);
+ cairo_translate (cr, x, y);
if (scrollbar->has_color)
{
@@ -1726,27 +1726,27 @@ clearlooks_draw_scrollbar_slider (cairo_t *cr,
if (widget->prelight)
ge_shade_color (&fill, 1.1, &fill);
-
+
cairo_set_line_width (cr, 1);
-
+
ge_shade_color (&fill, 1.3, &hilight);
ge_shade_color (&fill, 1.1, &shade1);
ge_shade_color (&fill, 1.05, &shade2);
ge_shade_color (&fill, 0.98, &shade3);
-
+
pattern = cairo_pattern_create_linear (1, 1, 1, height-2);
cairo_pattern_add_color_stop_rgb (pattern, 0, shade1.r, shade1.g, shade1.b);
cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade2.r, shade2.g, shade2.b);
- cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade3.r, shade3.g, shade3.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade3.r, shade3.g, shade3.b);
cairo_pattern_add_color_stop_rgb (pattern, 1, fill.r, fill.g, fill.b);
cairo_rectangle (cr, 1, 1, width-2, height-2);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.5);
ge_cairo_stroke_rectangle (cr, 1.5, 1.5, width-3, height-3);
-
+
ge_cairo_set_color (cr, border);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
}
@@ -1760,12 +1760,12 @@ clearlooks_draw_scrollbar_slider (cairo_t *cr,
int bar_x, i;
ge_shade_color(&colors->shade[6], 1.05, &border);
-
+
s2 = colors->bg[widget->state_type];
ge_shade_color(&s2, 1.06, &s1);
ge_shade_color(&s2, 0.98, &s3);
ge_shade_color(&s2, 0.94, &s4);
-
+
pattern = cairo_pattern_create_linear(1, 1, 1, height-1);
cairo_pattern_add_color_stop_rgb(pattern, 0, s1.r, s1.g, s1.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, s2.r, s2.g, s2.b);
@@ -1776,20 +1776,20 @@ clearlooks_draw_scrollbar_slider (cairo_t *cr,
cairo_set_source(cr, pattern);
cairo_fill(cr);
cairo_pattern_destroy(pattern);
-
+
clearlooks_set_border_gradient (cr, &border, 1.2, 0, height);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
-
+
cairo_move_to (cr, 1.5, height-1.5);
cairo_line_to (cr, 1.5, 1.5);
cairo_line_to (cr, width-1.5, 1.5);
ge_shade_color (&s2, 1.3, &s5);
cairo_set_source_rgba (cr, s5.r, s5.g, s5.b, 0.5);
cairo_stroke(cr);
-
+
/* draw handles */
cairo_set_line_width (cr, 1);
-
+
bar_x = width/2 - 4;
cairo_translate(cr, 0.5, 0.5);
for (i=0; i<3; i++)
@@ -1798,16 +1798,16 @@ clearlooks_draw_scrollbar_slider (cairo_t *cr,
cairo_line_to (cr, bar_x, height-5);
ge_cairo_set_color (cr, dark);
cairo_stroke (cr);
-
+
cairo_move_to (cr, bar_x+1, 4);
cairo_line_to (cr, bar_x+1, height-5);
ge_cairo_set_color (cr, light);
cairo_stroke (cr);
-
+
bar_x += 3;
}
}
-
+
}
static void
@@ -1892,7 +1892,7 @@ clearlooks_draw_handle (cairo_t *cr,
{
const CairoColor *fill = &colors->bg[params->state_type];
int num_bars = 6; /* shut up gcc warnings */
-
+
switch (handle->type)
{
case CL_HANDLE_TOOLBAR:
@@ -1909,11 +1909,11 @@ clearlooks_draw_handle (cairo_t *cr,
ge_cairo_set_color (cr, fill);
cairo_fill (cr);
}
-
+
cairo_translate (cr, x+0.5, y+0.5);
-
+
cairo_set_line_width (cr, 1);
-
+
if (handle->horizontal)
{
params->style_functions->draw_gripdots (cr, colors, 0, 0, width, height, num_bars, 2, 0.1);
@@ -2037,28 +2037,28 @@ clearlooks_draw_radiobutton (cairo_t *cr,
cairo_pattern_add_color_stop_rgba (pt, 0.5, shadow.r, shadow.b, shadow.g, 0.5);
cairo_pattern_add_color_stop_rgba (pt, 0.5, highlight.r, highlight.g, highlight.b, 0.5);
cairo_pattern_add_color_stop_rgb (pt, 1.0, highlight.r, highlight.g, highlight.b);
-
+
cairo_translate (cr, x, y);
-
+
cairo_set_line_width (cr, 2);
- cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
+ cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
cairo_set_source (cr, pt);
cairo_stroke (cr);
cairo_pattern_destroy (pt);
cairo_set_line_width (cr, 1);
- cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
-
+ cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
+
if (!widget->disabled)
{
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
-
+
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
-
+
if (draw_bullet)
{
if (inconsistent)
@@ -2077,7 +2077,7 @@ clearlooks_draw_radiobutton (cairo_t *cr,
cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
ge_cairo_set_color (cr, dot);
cairo_fill (cr);
-
+
cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
cairo_fill (cr);
@@ -2099,7 +2099,7 @@ clearlooks_draw_checkbox (cairo_t *cr,
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
-
+
if (widget->disabled)
{
border = &colors->shade[5];
@@ -2113,11 +2113,11 @@ clearlooks_draw_checkbox (cairo_t *cr,
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
if (widget->xthickness > 2 && widget->ythickness > 2)
{
widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, 1, CR_CORNER_ALL);
-
+
/* Draw the rectangle for the checkbox itself */
ge_cairo_rounded_rectangle (cr, 1.5, 1.5, width-3, height-3, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
@@ -2126,13 +2126,13 @@ clearlooks_draw_checkbox (cairo_t *cr,
/* Draw the rectangle for the checkbox itself */
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
-
+
if (!widget->disabled)
{
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
-
+
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
@@ -2149,13 +2149,13 @@ clearlooks_draw_checkbox (cairo_t *cr,
cairo_set_line_width (cr, 1.7);
cairo_move_to (cr, 0.5 + (width*0.2), (height*0.5));
cairo_line_to (cr, 0.5 + (width*0.4), (height*0.7));
-
+
cairo_curve_to (cr, 0.5 + (width*0.4), (height*0.7),
0.5 + (width*0.5), (height*0.4),
0.5 + (width*0.70), (height*0.25));
}
-
+
ge_cairo_set_color (cr, dot);
cairo_stroke (cr);
}
@@ -2174,7 +2174,7 @@ clearlooks_draw_normal_arrow (cairo_t *cr, const CairoColor *color,
arrow_width = MIN (height * 2.0 + MAX (1.0, ceil (height * 2.0 / 6.0 * 2.0) / 2.0) / 2.0, width);
line_width_2 = MAX (1.0, ceil (arrow_width / 6.0 * 2.0) / 2.0) / 2.0;
arrow_height = arrow_width / 2.0 + line_width_2;
-
+
cairo_translate (cr, x, y - arrow_height / 2.0);
cairo_move_to (cr, -arrow_width / 2.0, line_width_2);
@@ -2185,10 +2185,10 @@ clearlooks_draw_normal_arrow (cairo_t *cr, const CairoColor *color,
cairo_line_to (cr, arrow_width / 2.0, line_width_2);
cairo_line_to (cr, 0, arrow_height);
cairo_close_path (cr);
-
+
ge_cairo_set_color (cr, color);
cairo_fill (cr);
-
+
cairo_restore (cr);
}
@@ -2199,13 +2199,13 @@ clearlooks_draw_combo_arrow (cairo_t *cr, const CairoColor *color,
double arrow_width = MIN (height * 2 / 3.0, width);
double arrow_height = arrow_width / 2.0;
double gap_size = 1.0 * arrow_height;
-
+
cairo_save (cr);
cairo_translate (cr, x, y - (arrow_height + gap_size) / 2.0);
cairo_rotate (cr, G_PI);
clearlooks_draw_normal_arrow (cr, color, 0, 0, arrow_width, arrow_height);
cairo_restore (cr);
-
+
clearlooks_draw_normal_arrow (cr, color, x, y + (arrow_height + gap_size) / 2.0, arrow_width, arrow_height);
}
@@ -2215,7 +2215,7 @@ _clearlooks_draw_arrow (cairo_t *cr, const CairoColor *color,
double x, double y, double width, double height)
{
double rotate;
-
+
if (dir == CL_DIRECTION_LEFT)
rotate = G_PI*1.5;
else if (dir == CL_DIRECTION_RIGHT)
@@ -2226,11 +2226,11 @@ _clearlooks_draw_arrow (cairo_t *cr, const CairoColor *color,
rotate = 0;
else
return;
-
+
if (type == CL_ARROW_NORMAL)
{
cairo_translate (cr, x, y);
- cairo_rotate (cr, -rotate);
+ cairo_rotate (cr, -rotate);
clearlooks_draw_normal_arrow (cr, color, 0, 0, width, height);
}
else if (type == CL_ARROW_COMBO)
@@ -2249,10 +2249,10 @@ clearlooks_draw_arrow (cairo_t *cr,
{
const CairoColor *color = &colors->fg[widget->state_type];
gdouble tx, ty;
-
+
tx = x + width/2.0;
ty = y + height/2.0;
-
+
if (widget->disabled)
{
_clearlooks_draw_arrow (cr, &colors->shade[0],
@@ -2261,7 +2261,7 @@ clearlooks_draw_arrow (cairo_t *cr,
}
cairo_identity_matrix (cr);
-
+
_clearlooks_draw_arrow (cr, color, arrow->direction, arrow->type,
tx, ty, width, height);
}
diff --git a/libs/clearlooks-newer/clearlooks_draw_glossy.c b/libs/clearlooks-newer/clearlooks_draw_glossy.c
index 164ea2b33a..cf3c96a451 100644
--- a/libs/clearlooks-newer/clearlooks_draw_glossy.c
+++ b/libs/clearlooks-newer/clearlooks_draw_glossy.c
@@ -60,7 +60,7 @@ clearlooks_draw_glossy_gradient (cairo_t *cr,
cairo_set_source (cr, pt);
ge_cairo_rounded_rectangle (cr, x, y, width, height, radius, corners);
cairo_fill (cr);
-
+
cairo_pattern_destroy (pt);
}
@@ -203,42 +203,42 @@ clearlooks_glossy_draw_highlight_and_shade (cairo_t *cr,
/* not really sure of shading ratios... we will think */
ge_shade_color (bg_color, 0.8, &shadow);
ge_shade_color (bg_color, 1.2, &highlight);
-
+
cairo_save (cr);
-
+
/* Top/Left highlight */
if (corners & CR_CORNER_BOTTOMLEFT)
cairo_move_to (cr, x, y+height-radius);
else
cairo_move_to (cr, x, y+height);
-
+
ge_cairo_rounded_corner (cr, x, y, radius, corners & CR_CORNER_TOPLEFT);
if (corners & CR_CORNER_TOPRIGHT)
cairo_line_to (cr, x+width-radius, y);
else
cairo_line_to (cr, x+width, y);
-
+
if (params->shadow & CL_SHADOW_OUT)
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
else
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.5);
-
+
cairo_stroke (cr);
-
+
/* Bottom/Right highlight -- this includes the corners */
cairo_move_to (cr, x+width-radius, y); /* topright and by radius to the left */
ge_cairo_rounded_corner (cr, x+width, y, radius, corners & CR_CORNER_TOPRIGHT);
ge_cairo_rounded_corner (cr, x+width, y+height, radius, corners & CR_CORNER_BOTTOMRIGHT);
ge_cairo_rounded_corner (cr, x, y+height, radius, corners & CR_CORNER_BOTTOMLEFT);
-
+
if (params->shadow & CL_SHADOW_OUT)
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.5);
else
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
-
+
cairo_stroke (cr);
-
+
cairo_restore (cr);
}
@@ -255,7 +255,7 @@ clearlooks_glossy_draw_button (cairo_t *cr,
double radius;
cairo_pattern_t *pattern;
-
+
cairo_save (cr);
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
@@ -293,7 +293,7 @@ clearlooks_glossy_draw_button (cairo_t *cr,
ge_cairo_set_color (cr, &glow);
cairo_stroke (cr);
}
-
+
/* if (!(params->enable_glow && !params->active && !params->disabled)) */
if (!(params->prelight && params->enable_glow && !params->active)) {
if (!(params->disabled))
@@ -308,7 +308,7 @@ clearlooks_glossy_draw_button (cairo_t *cr,
clearlooks_draw_glossy_gradient (cr, xoffset+1, yoffset+1,
width-(xoffset*2)-2, height-(yoffset*2)-2,
&fill, params->disabled, radius, params->corners);
-
+
/* Pressed button shadow */
if (params->active)
{
@@ -320,16 +320,16 @@ clearlooks_glossy_draw_button (cairo_t *cr,
ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, height, radius, params->corners & (CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMLEFT));
cairo_clip (cr);
cairo_rectangle (cr, xoffset+1, yoffset+1, width-(xoffset*2)-2, 3);
-
+
pattern = cairo_pattern_create_linear (xoffset+1, yoffset+1, xoffset+1, yoffset+4);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.58);
cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.0);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_rectangle (cr, xoffset+1, yoffset+1, 3, height-(yoffset*2)-2);
-
+
pattern = cairo_pattern_create_linear (xoffset+1, yoffset+1, xoffset+4, yoffset+1);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, shadow.r, shadow.g, shadow.b, 0.58);
cairo_pattern_add_color_stop_rgba (pattern, 1.0, shadow.r, shadow.g, shadow.b, 0.0);
@@ -339,13 +339,13 @@ clearlooks_glossy_draw_button (cairo_t *cr,
cairo_restore (cr);
}
-
+
/* Default button highlight */
if (params->is_default && !params->active && !params->disabled)
{
const CairoColor *glow = &colors->spot[0];
double hh = (height-5)/2.0 + 1;
-
+
cairo_rectangle (cr, 3.5, 3.5, width-7, height-7);
ge_cairo_set_color (cr, glow);
cairo_stroke (cr);
@@ -355,7 +355,7 @@ clearlooks_glossy_draw_button (cairo_t *cr,
cairo_rel_line_to (cr, width-5, 0); cairo_rel_line_to (cr, 0, hh);
ge_cairo_set_color (cr, glow);
cairo_stroke (cr);
-
+
hh--;
glow = &colors->spot[1];
@@ -364,7 +364,7 @@ clearlooks_glossy_draw_button (cairo_t *cr,
ge_cairo_set_color (cr, glow);
cairo_stroke (cr);
}
-
+
/* Border */
if (params->is_default || (params->prelight && params->enable_glow))
border_normal = colors->spot[2];
@@ -390,14 +390,14 @@ clearlooks_glossy_draw_progressbar_trough (cairo_t *cr,
CairoColor shadow;
cairo_pattern_t *pattern;
double radius = MIN (params->radius, MIN ((height-2.0) / 2.0, (width-2.0) / 2.0));
-
+
cairo_save (cr);
cairo_set_line_width (cr, 1.0);
-
+
/* Fill with bg color */
ge_cairo_set_color (cr, &colors->bg[params->state_type]);
-
+
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
@@ -474,7 +474,7 @@ clearlooks_glossy_draw_progressbar_fill (cairo_t *cr,
stroke_width = height*2;
x_step = (((float)stroke_width/10)*offset); /* This looks weird ... */
-
+
cairo_translate (cr, x, y);
cairo_save (cr);
@@ -505,16 +505,16 @@ clearlooks_glossy_draw_progressbar_fill (cairo_t *cr,
cairo_line_to (cr, stroke_width-x_step, 0);
cairo_line_to (cr, stroke_width/2-x_step, height);
cairo_line_to (cr, -x_step, height);
-
+
cairo_translate (cr, stroke_width, 0);
tile_pos += stroke_width;
}
-
+
cairo_set_source_rgba (cr, colors->spot[2].r,
colors->spot[2].g,
colors->spot[2].b,
0.15);
-
+
cairo_fill (cr);
cairo_restore (cr); /* rounded clip region */
@@ -592,7 +592,7 @@ clearlooks_glossy_draw_progressbar_fill (cairo_t *cr,
ge_cairo_set_color (cr, &shadow);
cairo_stroke (cr);
}
-
+
cairo_restore (cr);
cairo_restore (cr); /* rotation, mirroring */
@@ -616,7 +616,7 @@ clearlooks_glossy_scale_draw_gradient (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
clearlooks_set_mixed_color (cr, c3, c1, 0.3);
ge_cairo_stroke_rectangle (cr, x, y, width, height);
}
@@ -636,7 +636,7 @@ clearlooks_glossy_draw_scale_trough (cairo_t *cr,
{
trough_width = width-3;
trough_height = TROUGH_SIZE-2;
-
+
translate_x = x + 0.5;
translate_y = y + 0.5 + (height/2) - (TROUGH_SIZE/2);
}
@@ -644,7 +644,7 @@ clearlooks_glossy_draw_scale_trough (cairo_t *cr,
{
trough_width = TROUGH_SIZE-2;
trough_height = height-3;
-
+
translate_x = x + 0.5 + (width/2) - (TROUGH_SIZE/2);
translate_y = y + 0.5;
}
@@ -654,9 +654,9 @@ clearlooks_glossy_draw_scale_trough (cairo_t *cr,
if (!slider->fill_level)
params->style_functions->draw_inset (cr, &params->parentbg, 0, 0, trough_width+2, trough_height+2, 0, 0);
-
+
cairo_translate (cr, 1, 1);
-
+
if (!slider->lower && !slider->fill_level)
clearlooks_glossy_scale_draw_gradient (cr, &colors->shade[3], /* top */
&colors->shade[2], /* bottom */
@@ -686,7 +686,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
CairoColor hilight;
cairo_pattern_t *pattern;
-
+
double radius;
radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
@@ -706,25 +706,25 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
if (tab->gap_side == CL_GAP_TOP || tab->gap_side == CL_GAP_BOTTOM)
{
height += 3.0;
-
+
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
}
else
{
width += 3.0;
-
+
if (tab->gap_side == CL_GAP_LEFT)
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
}
-
+
/* Set the fill color */
fill = &colors->bg[params->state_type];
/* Set tab shape */
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1,
radius, params->corners);
-
+
/* Draw fill */
ge_cairo_set_color (cr, fill);
cairo_fill (cr);
@@ -735,10 +735,10 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
if (!params->active)
{
ShadowParameters shadow;
-
+
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = params->corners;
-
+
clearlooks_glossy_draw_highlight_and_shade (cr, &colors->bg[0], &shadow,
width,
height, radius);
@@ -754,7 +754,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_BOTTOM ? height : 0);
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
ge_shade_color (fill, 1.06, &shadow);
ge_shade_color (fill, 1.18, &hilight);
ge_shade_color (fill, 1.12, &f1);
@@ -777,9 +777,9 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_TOP ? height-2 : 0,
tab->gap_side == CL_GAP_RIGHT ? width : 0,
tab->gap_side == CL_GAP_BOTTOM ? height : 0);
-
+
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
cairo_pattern_add_color_stop_rgba (pattern, 0.0, stripe_fill->r, stripe_fill->g, stripe_fill->b, 0.5);
cairo_pattern_add_color_stop_rgba (pattern, 0.8, fill->r, fill->g, fill->b, 0.0);
@@ -789,7 +789,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
}
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
if (params->active)
{
ge_cairo_set_color (cr, border);
@@ -801,7 +801,7 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_TOP ? height-2 : 2,
tab->gap_side == CL_GAP_RIGHT ? width : 2,
tab->gap_side == CL_GAP_BOTTOM ? height : 2);
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, 0.8, border->r, border->g, border->b);
cairo_set_source (cr, pattern);
@@ -822,7 +822,7 @@ clearlooks_glossy_draw_slider (cairo_t *cr,
CairoColor a, b, c, d;
cairo_pattern_t *pattern;
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
cairo_translate (cr, -0.5, -0.5);
@@ -840,7 +840,7 @@ clearlooks_glossy_draw_slider (cairo_t *cr,
pattern = cairo_pattern_create_linear (1, 1, 1, height-2);
cairo_pattern_add_color_stop_rgb (pattern, 0, a.r, a.g, a.b);
cairo_pattern_add_color_stop_rgb (pattern, 0.5, b.r, b.g, b.b);
- cairo_pattern_add_color_stop_rgb (pattern, 0.5, c.r, c.g, c.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.5, c.r, c.g, c.b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, d.r, d.g, d.b);
cairo_rectangle (cr, 1, 1, width-2, height-2);
cairo_set_source (cr, pattern);
@@ -868,12 +868,12 @@ clearlooks_glossy_draw_slider_button (cairo_t *cr,
double radius = MIN (params->radius, MIN ((width - 1.0) / 2.0, (height - 1.0) / 2.0));
cairo_set_line_width (cr, 1.0);
-
+
if (!slider->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
cairo_translate (cr, x+0.5, y+0.5);
-
+
params->style_functions->draw_shadow (cr, colors, radius, width-1, height-1);
params->style_functions->draw_slider (cr, colors, params, 1, 1, width-2, height-2);
}
@@ -891,7 +891,7 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
CairoColor fill, s1, s2, s4;
cairo_pattern_t *pattern;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
-
+
if (scrollbar->horizontal)
{
if (stepper->stepper == CL_STEPPER_A)
@@ -906,22 +906,22 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
else if (stepper->stepper == CL_STEPPER_D)
corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
}
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius, corners);
-
+
if (scrollbar->horizontal)
pattern = cairo_pattern_create_linear (0, 0, 0, height);
else
pattern = cairo_pattern_create_linear (0, 0, width, 0);
-
+
fill = colors->bg[widget->state_type];
ge_shade_color(&fill, 1.16, &s1);
ge_shade_color(&fill, 1.08, &s2);
ge_shade_color(&fill, 1.08, &s4);
-
+
cairo_pattern_add_color_stop_rgb(pattern, 0, s1.r, s1.g, s1.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, s2.r, s2.g, s2.b);
cairo_pattern_add_color_stop_rgb(pattern, 0.5, fill.r, fill.g, fill.b);
@@ -929,16 +929,16 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_translate (cr, 0.5, 0.5);
cairo_translate (cr, -0.5, -0.5);
-
+
ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, corners);
clearlooks_set_mixed_color (cr, border, &fill, 0.2);
if (widget->prelight)
ge_cairo_set_color (cr, &colors->spot[2]);
cairo_stroke (cr);
-
+
cairo_translate (cr, 0.5, 0.5);
}
@@ -975,7 +975,7 @@ clearlooks_glossy_draw_scrollbar_slider (cairo_t *cr,
else
height += 1;
}
-
+
if (!scrollbar->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
@@ -983,14 +983,14 @@ clearlooks_glossy_draw_scrollbar_slider (cairo_t *cr,
if (widget->prelight)
ge_shade_color (&fill, 1.1, &fill);
-
+
cairo_set_line_width (cr, 1);
-
+
ge_shade_color (&fill, 1.25, &hilight);
ge_shade_color (&fill, 1.16, &shade1);
ge_shade_color (&fill, 1.08, &shade2);
ge_shade_color (&fill, 1.08, &shade3);
-
+
pattern = cairo_pattern_create_linear (1, 1, 1, height-2);
cairo_pattern_add_color_stop_rgb (pattern, 0, shade1.r, shade1.g, shade1.b);
cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade2.r, shade2.g, shade2.b);
@@ -1000,7 +1000,7 @@ clearlooks_glossy_draw_scrollbar_slider (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
if (scrollbar->has_color)
{
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.5);
@@ -1050,7 +1050,7 @@ clearlooks_glossy_draw_list_view_header (cairo_t *cr,
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw highlight */
if (header->order == CL_ORDER_FIRST)
{
@@ -1059,19 +1059,19 @@ clearlooks_glossy_draw_list_view_header (cairo_t *cr,
}
else
cairo_move_to (cr, 0.0, 0.5);
-
+
cairo_line_to (cr, width, 0.5);
-
+
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.5);
cairo_stroke (cr);
-
+
/* Draw resize grip */
if ((params->ltr && header->order != CL_ORDER_LAST) ||
(!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
{
SeparatorParameters separator;
separator.horizontal = FALSE;
-
+
if (params->ltr)
params->style_functions->draw_separator (cr, colors, params, &separator,
width-1.5, 4.0, 2, height-8.0);
@@ -1090,7 +1090,7 @@ clearlooks_glossy_draw_toolbar (cairo_t *cr,
{
CairoColor light;
const CairoColor *dark;
-
+
const CairoColor *fill = &colors->bg[GTK_STATE_NORMAL];
dark = &colors->shade[3];
@@ -1099,15 +1099,15 @@ clearlooks_glossy_draw_toolbar (cairo_t *cr,
(void) height;
ge_shade_color (fill, 1.1, &light);
-
+
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
-
+
if (toolbar->style == 1) /* Enable Extra features */
{
cairo_pattern_t *pattern;
CairoColor shade1, shade2, shade3;
-
+
ge_shade_color (fill, 1.08, &shade1);
ge_shade_color (fill, 1.04, &shade2);
ge_shade_color (fill, 1.04, &shade3);
@@ -1137,7 +1137,7 @@ clearlooks_glossy_draw_toolbar (cairo_t *cr,
cairo_line_to (cr, width-1, 0.5);
ge_cairo_set_color (cr, &light);
cairo_stroke (cr);
- }
+ }
}
/* Draw shadow */
@@ -1271,9 +1271,9 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
cairo_pattern_add_color_stop_rgba (pt, 0.5, shadow.r, shadow.b, shadow.g, 0.5);
cairo_pattern_add_color_stop_rgba (pt, 0.5, highlight.r, highlight.g, highlight.b, 0.5);
cairo_pattern_add_color_stop_rgb (pt, 1.0, highlight.r, highlight.g, highlight.b);
-
+
cairo_translate (cr, x, y);
-
+
cairo_set_line_width (cr, 2);
cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
cairo_set_source (cr, pt);
@@ -1283,19 +1283,19 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
cairo_set_line_width (cr, 1);
cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
-
+
if (!widget->disabled)
{
if (widget->prelight)
clearlooks_set_mixed_color (cr, &colors->base[0], &colors->spot[1], 0.5);
- else
+ else
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
-
+
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
-
+
if (draw_bullet)
{
if (inconsistent)
@@ -1314,7 +1314,7 @@ clearlooks_glossy_draw_radiobutton (cairo_t *cr,
cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
ge_cairo_set_color (cr, dot);
cairo_fill (cr);
-
+
cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
cairo_fill (cr);
@@ -1336,7 +1336,7 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
-
+
if (widget->disabled)
{
border = &colors->shade[5];
@@ -1346,19 +1346,19 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
{
if (widget->prelight)
border = &colors->spot[2];
- else
+ else
border = &colors->shade[6];
dot = &colors->text[GTK_STATE_NORMAL];
}
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
if (widget->xthickness > 2 && widget->ythickness > 2)
{
widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5,
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
-
+
/* Draw the rectangle for the checkbox itself */
ge_cairo_rounded_rectangle (cr, 1.5, 1.5,
width-3, height-3, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
@@ -1369,7 +1369,7 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
ge_cairo_rounded_rectangle (cr, 0.5, 0.5,
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
-
+
if (!widget->disabled)
{
if (widget->prelight)
@@ -1378,7 +1378,7 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
-
+
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
@@ -1395,13 +1395,13 @@ clearlooks_glossy_draw_checkbox (cairo_t *cr,
cairo_set_line_width (cr, 1.7);
cairo_move_to (cr, 0.5 + (width*0.2), (height*0.5));
cairo_line_to (cr, 0.5 + (width*0.4), (height*0.7));
-
+
cairo_curve_to (cr, 0.5 + (width*0.4), (height*0.7),
0.5 + (width*0.5), (height*0.4),
0.5 + (width*0.70), (height*0.25));
}
-
+
ge_cairo_set_color (cr, dot);
cairo_stroke (cr);
}
diff --git a/libs/clearlooks-newer/clearlooks_draw_gummy.c b/libs/clearlooks-newer/clearlooks_draw_gummy.c
index 748d163468..97aca7eeac 100644
--- a/libs/clearlooks-newer/clearlooks_draw_gummy.c
+++ b/libs/clearlooks-newer/clearlooks_draw_gummy.c
@@ -123,7 +123,7 @@ clearlooks_gummy_draw_highlight_and_shade (cairo_t *cr,
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
else
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.5);
-
+
cairo_stroke (cr);
/* Bottom/Right highlight -- this includes the corners */
@@ -465,7 +465,7 @@ clearlooks_gummy_draw_progressbar_fill (cairo_t *cr,
cairo_line_to (cr, stroke_width-x_step, 0);
cairo_line_to (cr, stroke_width/2-x_step, height);
cairo_line_to (cr, -x_step, height);
-
+
cairo_translate (cr, stroke_width, 0);
tile_pos += stroke_width;
}
@@ -846,7 +846,7 @@ clearlooks_gummy_draw_slider (cairo_t *cr,
int bar_x, i;
int shift_x;
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
cairo_translate (cr, -0.5, -0.5);
@@ -1445,7 +1445,7 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr,
{
if (widget->prelight)
border = &colors->spot[2];
- else
+ else
border = &colors->shade[6];
dot = &colors->text[GTK_STATE_NORMAL];
}
@@ -1457,7 +1457,7 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr,
{
widget->style_functions->draw_inset (cr, &widget->parentbg, 0.5, 0.5,
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
-
+
/* Draw the rectangle for the checkbox itself */
ge_cairo_rounded_rectangle (cr, 1.5, 1.5,
width-3, height-3, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
@@ -1468,12 +1468,12 @@ clearlooks_gummy_draw_checkbox (cairo_t *cr,
ge_cairo_rounded_rectangle (cr, 0.5, 0.5,
width-1, height-1, (widget->radius > 0)? 1 : 0, CR_CORNER_ALL);
}
-
+
if (!widget->disabled)
- {
+ {
if (widget->prelight)
clearlooks_set_mixed_color (cr, &colors->base[0], &colors->spot[1], 0.5);
- else
+ else
ge_cairo_set_color (cr, &colors->base[0]);
cairo_fill_preserve (cr);
}
diff --git a/libs/clearlooks-newer/clearlooks_draw_inverted.c b/libs/clearlooks-newer/clearlooks_draw_inverted.c
index 6b8939ce51..2156b841b0 100644
--- a/libs/clearlooks-newer/clearlooks_draw_inverted.c
+++ b/libs/clearlooks-newer/clearlooks_draw_inverted.c
@@ -63,7 +63,7 @@ clearlooks_set_border_gradient (cairo_t *cr, const CairoColor *color, double hil
pattern = cairo_pattern_create_linear (0, 0, width, height);
cairo_pattern_add_color_stop_rgb (pattern, 0, color->r, color->g, color->b);
cairo_pattern_add_color_stop_rgb (pattern, 1, bottom_shade.r, bottom_shade.g, bottom_shade.b);
-
+
cairo_set_source (cr, pattern);
cairo_pattern_destroy (pattern);
}
@@ -76,16 +76,16 @@ clearlooks_inverted_draw_button (cairo_t *cr,
{
double xoffset = 0, yoffset = 0;
double radius = params->radius;
- const CairoColor *fill = &colors->bg[params->state_type];
+ const CairoColor *fill = &colors->bg[params->state_type];
const CairoColor *border_disabled = &colors->shade[4];
CairoColor border_normal;
CairoColor shadow;
ge_shade_color(&colors->shade[6], 1.05, &border_normal);
ge_shade_color (&border_normal, 0.925, &shadow);
-
+
cairo_save (cr);
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
@@ -104,21 +104,21 @@ clearlooks_inverted_draw_button (cairo_t *cr,
cairo_translate (cr, 0.5, 0.5);
params->style_functions->draw_inset (cr, &params->parentbg, 0, 0, width-1, height-1, radius+1, params->corners);
cairo_translate (cr, -0.5, -0.5);
- }
-
+ }
+
ge_cairo_rounded_rectangle (cr, xoffset+1, yoffset+1,
width-(xoffset*2)-2,
height-(yoffset*2)-2,
radius, params->corners);
-
+
if (!params->active)
{
cairo_pattern_t *pattern;
CairoColor top_shade, bottom_shade;
- ge_shade_color (fill, 0.95, &top_shade);
+ ge_shade_color (fill, 0.95, &top_shade);
ge_shade_color (fill, 1.05, &bottom_shade);
-
+
pattern = cairo_pattern_create_linear (0, 0, 0, height);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, top_shade.r, top_shade.g, top_shade.b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, bottom_shade.r, bottom_shade.g, bottom_shade.b);
@@ -129,7 +129,7 @@ clearlooks_inverted_draw_button (cairo_t *cr,
else
{
cairo_pattern_t *pattern;
-
+
ge_cairo_set_color (cr, fill);
cairo_fill_preserve (cr);
@@ -168,7 +168,7 @@ clearlooks_inverted_draw_button (cairo_t *cr,
ge_cairo_set_color (cr, d);
ge_cairo_stroke_rectangle (cr, 3.5, 3.5, width-7, height-7);
}
-
+
if (params->disabled)
ge_cairo_set_color (cr, border_disabled);
else
@@ -176,12 +176,12 @@ clearlooks_inverted_draw_button (cairo_t *cr,
clearlooks_set_border_gradient (cr, &border_normal, 1.32, 0, height);
else
ge_cairo_set_color (cr, &border_normal);
-
+
ge_cairo_rounded_rectangle (cr, xoffset + 0.5, yoffset + 0.5,
width-(xoffset*2)-1, height-(yoffset*2)-1,
radius, params->corners);
cairo_stroke (cr);
-
+
/* Draw the "shadow" */
if (!params->active)
{
@@ -191,7 +191,7 @@ clearlooks_inverted_draw_button (cairo_t *cr,
cairo_line_to (cr, width-params->xthickness, height - params->ythickness - 1);
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.1);
cairo_stroke (cr);
-
+
/* Draw topleft shadow */
clearlooks_draw_top_left_highlight (cr, fill, params, width, height, radius);
}
@@ -233,7 +233,7 @@ clearlooks_inverted_draw_progressbar_fill (cairo_t *cr,
stroke_width = height*2;
x_step = (((float)stroke_width/10)*offset); /* This looks weird ... */
-
+
cairo_translate (cr, x, y);
cairo_save (cr);
@@ -244,7 +244,7 @@ clearlooks_inverted_draw_progressbar_fill (cairo_t *cr,
ge_cairo_rounded_rectangle (cr, -radius, 0, width + radius, height, radius, CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT);
cairo_clip (cr);
-
+
ge_shade_color (&colors->spot[1], 1.05, &top_shade);
/* Draw the background gradient */
@@ -264,16 +264,16 @@ clearlooks_inverted_draw_progressbar_fill (cairo_t *cr,
cairo_line_to (cr, stroke_width-x_step, 0);
cairo_line_to (cr, stroke_width/2-x_step, height);
cairo_line_to (cr, -x_step, height);
-
+
cairo_translate (cr, stroke_width, 0);
tile_pos += stroke_width;
}
-
+
cairo_set_source_rgba (cr, colors->spot[2].r,
colors->spot[2].g,
colors->spot[2].b,
0.15);
-
+
cairo_fill (cr);
cairo_restore (cr); /* rounded clip region */
@@ -353,7 +353,7 @@ clearlooks_inverted_draw_progressbar_fill (cairo_t *cr,
ge_cairo_set_color (cr, &shadow);
cairo_stroke (cr);
}
-
+
cairo_restore (cr);
cairo_restore (cr); /* rotation, mirroring */
@@ -398,10 +398,10 @@ clearlooks_inverted_draw_menubaritem (cairo_t *cr,
CairoColor fill_shade;
CairoColor border = colors->spot[2];
cairo_pattern_t *pattern;
-
+
ge_shade_color (&border, 1.05, &border);
ge_shade_color (fill, 0.85, &fill_shade);
-
+
cairo_set_line_width (cr, 1.0);
ge_cairo_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1, height, widget->radius, widget->corners);
@@ -433,7 +433,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
CairoColor shadow;
cairo_pattern_t *pattern;
-
+
double radius;
double strip_size;
@@ -444,7 +444,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
cairo_clip (cr);
cairo_new_path (cr);
- /* Translate and set line width */
+ /* Translate and set line width */
cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x+0.5, y+0.5);
@@ -455,7 +455,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
{
height += 3.0;
strip_size = 2.0/height; /* 2 pixel high strip */
-
+
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
}
@@ -463,18 +463,18 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
{
width += 3.0;
strip_size = 2.0/width;
-
+
if (tab->gap_side == CL_GAP_LEFT)
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
}
-
+
/* Set the fill color */
fill = &colors->bg[params->state_type];
/* Set tab shape */
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1,
radius, params->corners);
-
+
/* Draw fill */
ge_cairo_set_color (cr, fill);
cairo_fill (cr);
@@ -489,7 +489,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_BOTTOM ? height : 0 );
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
ge_shade_color (fill, 0.92, &shadow);
cairo_pattern_add_color_stop_rgba (pattern, 0.0, hilight.r, hilight.g, hilight.b, 0.4);
@@ -507,9 +507,9 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_TOP ? height-2 : 0,
tab->gap_side == CL_GAP_RIGHT ? width : 0,
tab->gap_side == CL_GAP_BOTTOM ? height : 0 );
-
+
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_fill->r, stripe_fill->g, stripe_fill->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_fill->r, stripe_fill->g, stripe_fill->b);
@@ -521,10 +521,10 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
}
ge_cairo_rounded_rectangle (cr, 0, 0, width-1, height-1, radius, params->corners);
-
+
if (params->active)
{
- ge_cairo_set_color (cr, border2);
+ ge_cairo_set_color (cr, border2);
cairo_stroke (cr);
}
else
@@ -533,7 +533,7 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
tab->gap_side == CL_GAP_TOP ? height-2 : 2,
tab->gap_side == CL_GAP_RIGHT ? width : 2,
tab->gap_side == CL_GAP_BOTTOM ? height : 2 );
-
+
cairo_pattern_add_color_stop_rgb (pattern, 0.0, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, stripe_border->r, stripe_border->g, stripe_border->b);
cairo_pattern_add_color_stop_rgb (pattern, strip_size, border1->r, border1->g, border1->b);
@@ -557,7 +557,7 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
cairo_pattern_t *pattern;
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, 1.0);
cairo_translate (cr, x, y);
if (params->disabled)
@@ -634,10 +634,10 @@ clearlooks_inverted_draw_slider (cairo_t *cr,
{
cairo_move_to (cr, 6, 0.5);
cairo_line_to (cr, 6, height-1);
-
+
cairo_move_to (cr, width-7, 0.5);
cairo_line_to (cr, width-7, height-1);
-
+
cairo_set_line_width (cr, 1.0);
cairo_set_source_rgba (cr, border->r,
border->g,
@@ -656,7 +656,7 @@ clearlooks_inverted_draw_slider_button (cairo_t *cr,
{
double radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
cairo_set_line_width (cr, 1.0);
-
+
if (!slider->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
cairo_translate (cr, x+0.5, y+0.5);
@@ -683,12 +683,12 @@ clearlooks_inverted_draw_list_view_header (cairo_t *cr,
CairoColor shadow;
ge_shade_color (border, 1.5, &hilight);
- ge_shade_color (fill, 1.05, &hilight_header);
- ge_shade_color (fill, 0.95, &shadow);
+ ge_shade_color (fill, 1.05, &hilight_header);
+ ge_shade_color (fill, 0.95, &shadow);
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1.0);
-
+
/* Draw highlight */
if (header->order == CL_ORDER_FIRST)
{
@@ -697,19 +697,19 @@ clearlooks_inverted_draw_list_view_header (cairo_t *cr,
}
else
cairo_move_to (cr, 0.0, 0.5);
-
+
cairo_line_to (cr, width, 0.5);
-
+
ge_cairo_set_color (cr, &hilight);
cairo_stroke (cr);
-
+
/* Draw bottom border */
cairo_move_to (cr, 0.0, height-0.5);
cairo_line_to (cr, width, height-0.5);
ge_cairo_set_color (cr, border);
cairo_stroke (cr);
- /* Draw bottom shade */
+ /* Draw bottom shade */
pattern = cairo_pattern_create_linear (0.0, 0, 0.0, height-1.0);
cairo_pattern_add_color_stop_rgb (pattern, 0.0, shadow.r, shadow.g, shadow.b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, hilight_header.r, hilight_header.g, hilight_header.b);
@@ -718,14 +718,14 @@ clearlooks_inverted_draw_list_view_header (cairo_t *cr,
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
/* Draw resize grip */
if ((params->ltr && header->order != CL_ORDER_LAST) ||
(!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
{
SeparatorParameters separator;
separator.horizontal = FALSE;
-
+
if (params->ltr)
params->style_functions->draw_separator (cr, colors, params, &separator,
width-1.5, 4.0, 2, height-8.0);
@@ -749,7 +749,7 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
CairoColor s1, s2, s3;
cairo_pattern_t *pattern;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
-
+
ge_shade_color(&colors->shade[6], 1.05, &border);
if (scrollbar->horizontal)
@@ -766,21 +766,21 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
else if (stepper->stepper == CL_STEPPER_D)
corners = CR_CORNER_BOTTOMLEFT | CR_CORNER_BOTTOMRIGHT;
}
-
+
cairo_translate (cr, x, y);
cairo_set_line_width (cr, 1);
-
+
ge_cairo_rounded_rectangle (cr, 1, 1, width-2, height-2, radius, corners);
-
+
if (scrollbar->horizontal)
pattern = cairo_pattern_create_linear (0, 0, 0, height);
else
pattern = cairo_pattern_create_linear (0, 0, width, 0);
-
+
s1 = colors->bg[widget->state_type];
ge_shade_color(&s1, 0.95, &s2);
ge_shade_color(&s1, 1.05, &s3);
-
+
cairo_pattern_add_color_stop_rgb(pattern, 0, s2.r, s2.g, s2.b);
cairo_pattern_add_color_stop_rgb(pattern, 1.0, s3.r, s3.g, s3.b);
cairo_set_source (cr, pattern);
@@ -789,10 +789,10 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
clearlooks_draw_top_left_highlight (cr, &s1, widget, width, height, radius);
- ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, corners);
+ ge_cairo_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, radius, corners);
clearlooks_set_border_gradient (cr, &border, 1.2, (scrollbar->horizontal ? 0 : width), (scrollbar->horizontal ? height: 0));
cairo_stroke (cr);
-
+
cairo_translate (cr, 0.5, 0.5);
}
@@ -823,11 +823,11 @@ clearlooks_inverted_draw_scrollbar_slider (cairo_t *cr,
else
height += 1;
}
-
+
if (!scrollbar->horizontal)
ge_cairo_exchange_axis (cr, &x, &y, &width, &height);
- cairo_translate (cr, x, y);
+ cairo_translate (cr, x, y);
if (scrollbar->has_color)
{
@@ -836,30 +836,30 @@ clearlooks_inverted_draw_scrollbar_slider (cairo_t *cr,
CairoColor hilight;
CairoColor shade1, shade2, shade3;
cairo_pattern_t *pattern;
-
+
if (widget->prelight)
ge_shade_color (&fill, 1.1, &fill);
-
+
cairo_set_line_width (cr, 1);
-
+
ge_shade_color (&fill, 1.3, &hilight);
ge_shade_color (&fill, 1.1, &shade1);
ge_shade_color (&fill, 1.05, &shade2);
ge_shade_color (&fill, 0.98, &shade3);
-
+
pattern = cairo_pattern_create_linear (1, 1, 1, height-2);
cairo_pattern_add_color_stop_rgb (pattern, 0, fill.r, fill.g, fill.b);
cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade3.r, shade3.g, shade3.b);
- cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade2.r, shade2.g, shade2.b);
+ cairo_pattern_add_color_stop_rgb (pattern, 0.5, shade2.r, shade2.g, shade2.b);
cairo_pattern_add_color_stop_rgb (pattern, 1.0, shade1.r, shade1.g, shade1.b);
cairo_rectangle (cr, 1, 1, width-2, height-2);
cairo_set_source (cr, pattern);
cairo_fill (cr);
cairo_pattern_destroy (pattern);
-
+
cairo_set_source_rgba (cr, hilight.r, hilight.g, hilight.b, 0.5);
ge_cairo_stroke_rectangle (cr, 1.5, 1.5, width-3, height-3);
-
+
ge_cairo_set_color (cr, border);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
}
@@ -869,9 +869,9 @@ clearlooks_inverted_draw_scrollbar_slider (cairo_t *cr,
CairoColor s1, s2, s3;
cairo_pattern_t *pattern;
int bar_x, i;
-
+
const CairoColor *dark = &colors->shade[4];
- const CairoColor *light = &colors->shade[0];
+ const CairoColor *light = &colors->shade[0];
ge_shade_color(&colors->shade[6], 1.05, &border);
@@ -888,15 +888,15 @@ clearlooks_inverted_draw_scrollbar_slider (cairo_t *cr,
cairo_set_source(cr, pattern);
cairo_fill(cr);
cairo_pattern_destroy(pattern);
-
+
clearlooks_draw_top_left_highlight (cr, &s2, widget, width, height, 0);
clearlooks_set_border_gradient (cr, &border, 1.2, 0, height);
ge_cairo_stroke_rectangle (cr, 0.5, 0.5, width-1, height-1);
-
+
/* draw handles */
cairo_set_line_width (cr, 1);
-
+
bar_x = width/2 - 4;
cairo_translate(cr, 0.5, 0.5);
for (i=0; i<3; i++)
@@ -905,12 +905,12 @@ clearlooks_inverted_draw_scrollbar_slider (cairo_t *cr,
cairo_line_to (cr, bar_x, height-5);
ge_cairo_set_color (cr, dark);
cairo_stroke (cr);
-
+
cairo_move_to (cr, bar_x+1, 4);
cairo_line_to (cr, bar_x+1, height-5);
ge_cairo_set_color (cr, light);
cairo_stroke (cr);
-
+
bar_x += 3;
}
}
@@ -927,7 +927,7 @@ clearlooks_inverted_draw_selected_cell (cairo_t *cr,
CairoColor border;
cairo_pattern_t *pattern;
cairo_save (cr);
-
+
cairo_translate (cr, x, y);
if (params->focus)
@@ -951,7 +951,7 @@ clearlooks_inverted_draw_selected_cell (cairo_t *cr,
cairo_fill (cr);
cairo_pattern_destroy (pattern);
- ge_shade_color(&upper_color, 0.8, &border);
+ ge_shade_color(&upper_color, 0.8, &border);
cairo_move_to (cr, 0, 0.5);
cairo_rel_line_to (cr, width, 0);
@@ -975,7 +975,7 @@ clearlooks_register_style_inverted (ClearlooksStyleFunctions *functions)
functions->draw_menubaritem = clearlooks_inverted_draw_menubaritem;
functions->draw_tab = clearlooks_inverted_draw_tab;
functions->draw_list_view_header = clearlooks_inverted_draw_list_view_header;
- functions->draw_scrollbar_stepper = clearlooks_inverted_draw_scrollbar_stepper;
+ functions->draw_scrollbar_stepper = clearlooks_inverted_draw_scrollbar_stepper;
functions->draw_scrollbar_slider = clearlooks_inverted_draw_scrollbar_slider;
functions->draw_selected_cell = clearlooks_inverted_draw_selected_cell;
}
diff --git a/libs/clearlooks-newer/clearlooks_rc_style.c b/libs/clearlooks-newer/clearlooks_rc_style.c
index a4f8032e65..fdce13af1c 100644
--- a/libs/clearlooks-newer/clearlooks_rc_style.c
+++ b/libs/clearlooks-newer/clearlooks_rc_style.c
@@ -333,7 +333,7 @@ static guint
clearlooks_rc_style_parse (GtkRcStyle *rc_style,
GtkSettings *settings,
GScanner *scanner)
-
+
{
static GQuark scope_id = 0;
ClearlooksRcStyle *clearlooks_style = CLEARLOOKS_RC_STYLE (rc_style);
@@ -482,6 +482,6 @@ static GtkStyle *
clearlooks_rc_style_create_style (GtkRcStyle *rc_style)
{
(void) rc_style;
-
+
return GTK_STYLE (g_object_new (CLEARLOOKS_TYPE_STYLE, NULL));
}
diff --git a/libs/clearlooks-newer/clearlooks_style.c b/libs/clearlooks-newer/clearlooks_style.c
index 59e64d5430..b1257f4878 100644
--- a/libs/clearlooks-newer/clearlooks_style.c
+++ b/libs/clearlooks-newer/clearlooks_style.c
@@ -65,7 +65,7 @@ clearlooks_set_widget_parameters (const GtkWidget *widget,
params->active = (state_type == GTK_STATE_ACTIVE);
params->prelight = (state_type == GTK_STATE_PRELIGHT);
- params->disabled = (state_type == GTK_STATE_INSENSITIVE);
+ params->disabled = (state_type == GTK_STATE_INSENSITIVE);
params->state_type = (ClearlooksStateType)state_type;
params->corners = CR_CORNER_ALL;
params->ltr = ge_widget_is_ltr ((GtkWidget*)widget);
@@ -76,10 +76,10 @@ clearlooks_set_widget_parameters (const GtkWidget *widget,
if (!params->active && widget && GE_IS_TOGGLE_BUTTON (widget))
params->active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
+
params->xthickness = style->xthickness;
params->ythickness = style->ythickness;
-
+
/* This is used in GtkEntry to fake transparency. The reason to do this
* is that the entry has it's entire background filled with base[STATE].
* This is not a very good solution as it will eg. fail if one changes
@@ -91,7 +91,7 @@ clearlooks_set_widget_parameters (const GtkWidget *widget,
static void
clearlooks_style_draw_flat_box (DRAW_ARGS)
{
- if (detail &&
+ if (detail &&
state_type == GTK_STATE_SELECTED && (
!strncmp ("cell_even", detail, 9) ||
!strncmp ("cell_odd", detail, 8)))
@@ -162,7 +162,7 @@ clearlooks_style_draw_shadow (DRAW_ARGS)
(DETAIL ("frame") && ge_is_in_combo_box (widget)))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
/* Override the entries state type, because we are too lame to handle this via
@@ -175,25 +175,25 @@ clearlooks_style_draw_shadow (DRAW_ARGS)
width += style->xthickness;
if (!params.ltr)
x -= style->xthickness;
-
+
if (params.ltr)
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
else
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
}
-
+
STYLE_FUNCTION (draw_entry) (cr, &clearlooks_style->colors, &params,
x, y, width, height);
}
else if (DETAIL ("frame") && widget && GE_IS_STATUSBAR (widget->parent))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
gtk_style_apply_default_background (style, window, TRUE, state_type,
area, x, y, width, height);
-
+
STYLE_FUNCTION (draw_statusbar) (cr, colors, &params,
x, y, width, height);
}
@@ -204,10 +204,10 @@ clearlooks_style_draw_shadow (DRAW_ARGS)
frame.shadow = shadow_type;
frame.gap_x = -1; /* No gap will be drawn */
frame.border = &colors->shade[4];
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
params.corners = CR_CORNER_NONE;
-
+
if (widget && !g_str_equal ("XfcePanelWindow", gtk_widget_get_name (gtk_widget_get_toplevel (widget))))
STYLE_FUNCTION(draw_frame) (cr, colors, &params, &frame,
x, y, width, height);
@@ -230,10 +230,10 @@ clearlooks_style_draw_shadow (DRAW_ARGS)
frame.border = &colors->shade[5];
clearlooks_set_widget_parameters (widget, style, state_type, &params);
params.corners = CR_CORNER_ALL;
-
+
STYLE_FUNCTION(draw_frame) (cr, colors, &params, &frame, x, y, width, height);
}
-
+
cairo_destroy (cr);
}
@@ -257,13 +257,13 @@ clearlooks_style_draw_box_gap (DRAW_ARGS,
WidgetParameters params;
FrameParameters frame;
gboolean start, end;
-
+
frame.shadow = shadow_type;
frame.gap_side = gap_side;
frame.gap_x = gap_x;
frame.gap_width = gap_width;
frame.border = &colors->shade[5];
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
clearlooks_get_notebook_tab_position (widget, &start, &end);
@@ -314,7 +314,7 @@ clearlooks_style_draw_box_gap (DRAW_ARGS,
ge_cairo_rounded_rectangle (cr, x, y, width, height, params.radius, params.corners);
ge_cairo_set_color (cr, &colors->bg[GTK_STATE_NORMAL]);
cairo_fill (cr);
-
+
STYLE_FUNCTION(draw_frame) (cr, colors, &params, &frame,
x, y, width, height);
}
@@ -325,8 +325,8 @@ clearlooks_style_draw_box_gap (DRAW_ARGS,
x, y, width, height,
gap_side, gap_x, gap_width);
}
-
- cairo_destroy (cr);
+
+ cairo_destroy (cr);
}
static void
@@ -340,16 +340,16 @@ clearlooks_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
SANITIZE_SIZE
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
if (DETAIL ("tab"))
{
WidgetParameters params;
TabParameters tab;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
tab.gap_side = (ClearlooksGapSide)gap_side;
-
+
switch (gap_side)
{
case CL_GAP_BOTTOM:
@@ -364,7 +364,7 @@ clearlooks_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
case CL_GAP_LEFT:
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
}
-
+
STYLE_FUNCTION(draw_tab) (cr, colors, &params, &tab,
x, y, width, height);
}
@@ -375,7 +375,7 @@ clearlooks_style_draw_extension (DRAW_ARGS, GtkPositionType gap_side)
gap_side);
}
-
+
cairo_destroy (cr);
}
@@ -386,15 +386,15 @@ clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
ClearlooksColors *colors = &clearlooks_style->colors;
cairo_t *cr;
gboolean is_horizontal;
-
+
CHECK_ARGS
SANITIZE_SIZE
-
+
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
/* Evil hack to work around broken orientation for toolbars */
is_horizontal = (width > height);
-
+
if (DETAIL ("handlebox"))
{
WidgetParameters params;
@@ -403,7 +403,7 @@ clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
clearlooks_set_widget_parameters (widget, style, state_type, &params);
handle.type = CL_HANDLE_TOOLBAR;
handle.horizontal = is_horizontal;
-
+
/* Is this ever true? -Daniel */
if (GE_IS_TOOLBAR (widget) && shadow_type != GTK_SHADOW_NONE)
{
@@ -417,7 +417,7 @@ clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
STYLE_FUNCTION(draw_toolbar) (cr, colors, &params, &toolbar, x, y, width, height);
cairo_restore (cr);
}
-
+
STYLE_FUNCTION(draw_handle) (cr, colors, &params, &handle,
x, y, width, height);
}
@@ -429,7 +429,7 @@ clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
clearlooks_set_widget_parameters (widget, style, state_type, &params);
handle.type = CL_HANDLE_SPLITTER;
handle.horizontal = orientation == GTK_ORIENTATION_HORIZONTAL;
-
+
STYLE_FUNCTION(draw_handle) (cr, colors, &params, &handle,
x, y, width, height);
}
@@ -441,7 +441,7 @@ clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
clearlooks_set_widget_parameters (widget, style, state_type, &params);
handle.type = CL_HANDLE_TOOLBAR;
handle.horizontal = is_horizontal;
-
+
/* Is this ever true? -Daniel */
if (GE_IS_TOOLBAR (widget) && shadow_type != GTK_SHADOW_NONE)
{
@@ -455,7 +455,7 @@ clearlooks_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
STYLE_FUNCTION(draw_toolbar) (cr, colors, &params, &toolbar, x, y, width, height);
cairo_restore (cr);
}
-
+
STYLE_FUNCTION(draw_handle) (cr, colors, &params, &handle,
x, y, width, height);
}
@@ -480,7 +480,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
MenuBarParameters menubar;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
menubar.style = clearlooks_style->menubarstyle;
@@ -495,18 +495,18 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
ListViewHeaderParameters header;
-
+
gint columns, column_index;
gboolean resizable = TRUE;
-
+
/* XXX: This makes unknown treeview header CL_ORDER_MIDDLE, in need for something nicer */
columns = 3;
column_index = 1;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
params.corners = CR_CORNER_NONE;
-
+
if (GE_IS_TREE_VIEW (widget->parent))
{
clearlooks_treeview_get_header_index (GTK_TREE_VIEW(widget->parent),
@@ -518,18 +518,18 @@ clearlooks_style_draw_box (DRAW_ARGS)
clearlooks_clist_get_header_index (GTK_CLIST(widget->parent),
widget, &column_index, &columns);
}
-
+
header.resizable = resizable;
-
+
if (column_index == 0)
header.order = params.ltr ? CL_ORDER_FIRST : CL_ORDER_LAST;
else if (column_index == columns-1)
header.order = params.ltr ? CL_ORDER_LAST : CL_ORDER_FIRST;
else
header.order = CL_ORDER_MIDDLE;
-
+
gtk_style_apply_default_background (style, window, FALSE, state_type, area, x, y, width, height);
-
+
STYLE_FUNCTION(draw_list_view_header) (cr, colors, &params, &header,
x, y, width, height);
}
@@ -562,7 +562,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
if (GE_IS_TOGGLE_BUTTON (widget) &&
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
params.active = TRUE;
-
+
STYLE_FUNCTION(draw_button) (cr, &clearlooks_style->colors, &params,
x, y, width, height);
}
@@ -572,14 +572,14 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
if (style->xthickness == 3)
{
width++;
if (params.ltr)
x--;
}
-
+
if (DETAIL ("spinbutton_up"))
{
height+=2;
@@ -595,28 +595,28 @@ clearlooks_style_draw_box (DRAW_ARGS)
else
params.corners = CR_CORNER_BOTTOMLEFT;
}
-
+
STYLE_FUNCTION(draw_spinbutton_down) (cr, &clearlooks_style->colors, &params, x, y, width, height);
}
}
else if (DETAIL ("spinbutton"))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
if (params.ltr)
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
else
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
-
+
if (style->xthickness == 3)
{
if (params.ltr)
x--;
width++;
}
-
+
STYLE_FUNCTION(draw_spinbutton) (cr, &clearlooks_style->colors, &params,
x, y, width, height);
}
@@ -624,15 +624,15 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
SliderParameters slider;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
params.corners = CR_CORNER_NONE;
-
+
slider.lower = DETAIL ("trough-lower");
slider.fill_level = DETAIL ("trough-fill-level") || DETAIL ("trough-fill-level-full");
slider.horizontal = (GTK_RANGE (widget)->orientation == GTK_ORIENTATION_HORIZONTAL);
-
+
STYLE_FUNCTION(draw_scale_trough) (cr, &clearlooks_style->colors,
&params, &slider,
x, y, width, height);
@@ -640,9 +640,9 @@ clearlooks_style_draw_box (DRAW_ARGS)
else if (DETAIL ("trough") && widget && GE_IS_PROGRESS_BAR (widget))
{
WidgetParameters params;
-
- clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
+ clearlooks_set_widget_parameters (widget, style, state_type, &params);
+
STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, &params,
x, y, width, height);
}
@@ -650,16 +650,16 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
ScrollBarParameters scrollbar;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
params.corners = CR_CORNER_NONE;
-
+
scrollbar.horizontal = TRUE;
scrollbar.junction = clearlooks_scrollbar_get_junction (widget);
-
+
if (GE_IS_RANGE (widget))
scrollbar.horizontal = GTK_RANGE (widget)->orientation == GTK_ORIENTATION_HORIZONTAL;
-
+
if (scrollbar.horizontal)
{
x += 2;
@@ -670,7 +670,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
y += 2;
height -= 4;
}
-
+
STYLE_FUNCTION(draw_scrollbar_trough) (cr, colors, &params, &scrollbar,
x, y, width, height);
}
@@ -682,9 +682,9 @@ clearlooks_style_draw_box (DRAW_ARGS)
#ifdef HAVE_ANIMATION
if(clearlooks_style->animation && CL_IS_PROGRESS_BAR (widget))
- {
+ {
gboolean activity_mode = GTK_PROGRESS (widget)->activity_mode;
-
+
if (!activity_mode)
clearlooks_animation_progressbar_add ((gpointer)widget);
}
@@ -706,7 +706,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
progressbar.value = 0;
progressbar.pulsing = FALSE;
}
-
+
if (!params.ltr)
{
if (progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
@@ -750,12 +750,12 @@ clearlooks_style_draw_box (DRAW_ARGS)
tmp.height += 2;
}
}
-
+
cairo_reset_clip (cr);
gdk_cairo_rectangle (cr, &tmp);
cairo_clip (cr);
}
-
+
STYLE_FUNCTION(draw_progressbar_fill) (cr, colors, &params, &progressbar,
x, y, width, height,
10 - (int)(elapsed * 10.0) % 10);
@@ -764,29 +764,29 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
OptionMenuParameters optionmenu;
-
+
GtkRequisition indicator_size;
GtkBorder indicator_spacing;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
params.enable_glow = TRUE;
ge_option_menu_get_props (widget, &indicator_size, &indicator_spacing);
-
+
if (ge_widget_is_ltr (widget))
optionmenu.linepos = width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - 1;
else
optionmenu.linepos = (indicator_size.width + indicator_spacing.left + indicator_spacing.right) + 1;
-
+
STYLE_FUNCTION(draw_optionmenu) (cr, colors, &params, &optionmenu,
- x, y, width, height);
+ x, y, width, height);
}
else if (DETAIL ("menuitem"))
{
WidgetParameters params;
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
if (widget && GE_IS_MENU_BAR (widget->parent))
{
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_TOPRIGHT;
@@ -794,7 +794,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
STYLE_FUNCTION(draw_menubaritem) (cr, colors, &params, x, y, width, height);
}
else
- {
+ {
params.corners = CR_CORNER_ALL;
STYLE_FUNCTION(draw_menuitem) (cr, colors, &params, x, y, width, height);
}
@@ -805,15 +805,15 @@ clearlooks_style_draw_box (DRAW_ARGS)
ScrollBarParameters scrollbar;
ScrollBarStepperParameters stepper;
GdkRectangle this_rectangle;
-
+
this_rectangle.x = x;
this_rectangle.y = y;
this_rectangle.width = width;
this_rectangle.height = height;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
params.corners = CR_CORNER_NONE;
-
+
scrollbar.has_color = FALSE;
scrollbar.horizontal = TRUE;
scrollbar.junction = clearlooks_scrollbar_get_junction (widget);
@@ -823,7 +823,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
}
scrollbar.horizontal = DETAIL ("hscrollbar");
-
+
stepper.stepper = clearlooks_scrollbar_get_stepper (widget, &this_rectangle);
STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, &params, &scrollbar, &stepper,
@@ -845,14 +845,14 @@ clearlooks_style_draw_box (DRAW_ARGS)
}
else if (DETAIL ("trough"))
{
-
+
}
else if (DETAIL ("menu"))
{
WidgetParameters params;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
STYLE_FUNCTION(draw_menu_frame) (cr, colors, &params, x, y, width, height);
}
else if (DETAIL ("hseparator") || DETAIL ("vseparator"))
@@ -878,7 +878,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
clearlooks_parent_class->draw_box (style, window, state_type, shadow_type, area,
widget, detail, x, y, width, height);
}
-
+
cairo_destroy (cr);
}
@@ -894,21 +894,21 @@ clearlooks_style_draw_slider (DRAW_ARGS, GtkOrientation orientation)
CHECK_ARGS
SANITIZE_SIZE
-
+
if (DETAIL ("hscale") || DETAIL ("vscale"))
{
WidgetParameters params;
SliderParameters slider;
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
slider.horizontal = (orientation == GTK_ORIENTATION_HORIZONTAL);
slider.lower = FALSE;
slider.fill_level = FALSE;
-
+
if (clearlooks_style->style == CL_STYLE_GLOSSY) /* XXX! */
params.corners = CR_CORNER_ALL;
-
+
STYLE_FUNCTION(draw_slider_button) (cr, &clearlooks_style->colors,
&params, &slider,
x, y, width, height);
@@ -940,7 +940,7 @@ clearlooks_style_draw_slider (DRAW_ARGS, GtkOrientation orientation)
if ((clearlooks_style->style == CL_STYLE_GLOSSY || clearlooks_style->style == CL_STYLE_GUMMY)
&& !scrollbar.has_color)
scrollbar.color = colors->bg[0];
-
+
STYLE_FUNCTION(draw_scrollbar_slider) (cr, colors, &params, &scrollbar,
x, y, width, height);
}
@@ -961,7 +961,7 @@ clearlooks_style_draw_option (DRAW_ARGS)
CheckboxParameters checkbox;
cairo_t *cr;
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-
+
(void) detail;
CHECK_ARGS
@@ -969,12 +969,12 @@ clearlooks_style_draw_option (DRAW_ARGS)
cr = ge_gdk_drawable_to_cairo (window, area);
colors = &clearlooks_style->colors;
-
+
checkbox.shadow_type = shadow_type;
checkbox.in_menu = (widget && GTK_IS_MENU(widget->parent));
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
STYLE_FUNCTION(draw_radiobutton) (cr, colors, &params, &checkbox, x, y, width, height);
cairo_destroy (cr);
@@ -992,11 +992,11 @@ clearlooks_style_draw_check (DRAW_ARGS)
SANITIZE_SIZE
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
-
+
params.corners = CR_CORNER_ALL;
-
+
checkbox.shadow_type = shadow_type;
checkbox.in_cell = DETAIL("cellcheck");
@@ -1004,7 +1004,7 @@ clearlooks_style_draw_check (DRAW_ARGS)
STYLE_FUNCTION(draw_checkbox) (cr, &clearlooks_style->colors, &params, &checkbox,
x, y, width, height);
-
+
cairo_destroy (cr);
}
@@ -1041,7 +1041,7 @@ clearlooks_style_draw_vline (GtkStyle *style,
* (and even if, a normal one should be better on menu bars) */
STYLE_FUNCTION(draw_separator) (cr, colors, NULL, &separator,
x, y1, 2, y2-y1+1);
-
+
cairo_destroy (cr);
}
@@ -1069,16 +1069,16 @@ clearlooks_style_draw_hline (GtkStyle *style,
colors = &clearlooks_style->colors;
cr = ge_gdk_drawable_to_cairo (window, area);
-
+
separator.horizontal = TRUE;
-
+
if (!DETAIL ("menuitem"))
STYLE_FUNCTION(draw_separator) (cr, colors, NULL, &separator,
x1, y, x2-x1+1, 2);
else
STYLE_FUNCTION(draw_menu_item_separator) (cr, colors, NULL, &separator,
x1, y, x2-x1+1, 2);
-
+
cairo_destroy (cr);
}
@@ -1097,22 +1097,22 @@ clearlooks_style_draw_shadow_gap (DRAW_ARGS,
cr = ge_gdk_drawable_to_cairo (window, area);
colors = &clearlooks_style->colors;
-
+
if (DETAIL ("frame"))
{
WidgetParameters params;
FrameParameters frame;
-
+
frame.shadow = shadow_type;
frame.gap_side = gap_side;
frame.gap_x = gap_x;
frame.gap_width = gap_width;
frame.border = &colors->shade[5];
-
+
clearlooks_set_widget_parameters (widget, style, state_type, &params);
params.corners = CR_CORNER_ALL;
-
+
STYLE_FUNCTION(draw_frame) (cr, colors, &params, &frame,
x, y, width, height);
}
@@ -1122,7 +1122,7 @@ clearlooks_style_draw_shadow_gap (DRAW_ARGS,
widget, detail, x, y, width, height,
gap_side, gap_x, gap_width);
}
-
+
cairo_destroy (cr);
}
@@ -1157,7 +1157,7 @@ clearlooks_style_draw_resize_grip (GtkStyle *style,
cr = ge_gdk_drawable_to_cairo (window, area);
- clearlooks_set_widget_parameters (widget, style, state_type, &params);
+ clearlooks_set_widget_parameters (widget, style, state_type, &params);
STYLE_FUNCTION(draw_resize_grip) (cr, colors, &params, &grip,
x, y, width, height);
@@ -1170,7 +1170,7 @@ clearlooks_style_draw_tab (DRAW_ARGS)
{
ClearlooksColors *colors;
WidgetParameters params;
- ArrowParameters arrow;
+ ArrowParameters arrow;
cairo_t *cr;
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
@@ -1180,12 +1180,12 @@ clearlooks_style_draw_tab (DRAW_ARGS)
CHECK_ARGS
SANITIZE_SIZE
-
+
cr = ge_gdk_drawable_to_cairo (window, area);
clearlooks_set_widget_parameters (widget, style, state_type, &params);
arrow.type = CL_ARROW_COMBO;
- arrow.direction = CL_DIRECTION_DOWN;
+ arrow.direction = CL_DIRECTION_DOWN;
STYLE_FUNCTION(draw_arrow) (cr, colors, &params, &arrow, x, y, width, height);
@@ -1231,12 +1231,12 @@ clearlooks_style_draw_arrow (GtkStyle *style,
clearlooks_set_widget_parameters (widget, style, state_type, &params);
arrow.type = CL_ARROW_NORMAL;
arrow.direction = (ClearlooksDirection)arrow_type;
-
+
if (ge_is_combo_box (widget, FALSE) && !ge_is_combo_box_entry (widget))
{
arrow.type = CL_ARROW_COMBO;
}
-
+
/* I have no idea why, but the arrow of GtkCombo is larger than in other places.
* Subtracting 3 seems to fix this. */
if (widget && widget->parent && GE_IS_COMBO (widget->parent->parent))
@@ -1247,9 +1247,9 @@ clearlooks_style_draw_arrow (GtkStyle *style,
x += 2;
width -= 3;
}
-
+
STYLE_FUNCTION(draw_arrow) (cr, colors, &params, &arrow, x, y, width, height);
-
+
cairo_destroy (cr);
}
@@ -1258,12 +1258,12 @@ clearlooks_style_init_from_rc (GtkStyle * style,
GtkRcStyle * rc_style)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-
+
clearlooks_parent_class->init_from_rc (style, rc_style);
-
+
g_assert ((CLEARLOOKS_RC_STYLE (rc_style)->style < CL_NUM_STYLES));
clearlooks_style->style = CLEARLOOKS_RC_STYLE (rc_style)->style;
-
+
clearlooks_style->menubarstyle = CLEARLOOKS_RC_STYLE (rc_style)->menubarstyle;
clearlooks_style->toolbarstyle = CLEARLOOKS_RC_STYLE (rc_style)->toolbarstyle;
clearlooks_style->has_scrollbar_color = CLEARLOOKS_RC_STYLE (rc_style)->flags & CL_FLAG_SCROLLBAR_COLOR;
@@ -1284,11 +1284,11 @@ clearlooks_style_realize (GtkStyle * style)
CairoColor bg_normal;
double contrast;
int i;
-
+
clearlooks_parent_class->realize (style);
contrast = CLEARLOOKS_RC_STYLE (style->rc_style)->contrast;
-
+
/* Lighter to darker */
ge_gdk_color_to_cairo (&style->bg[GTK_STATE_NORMAL], &bg_normal);
@@ -1296,13 +1296,13 @@ clearlooks_style_realize (GtkStyle * style)
{
ge_shade_color(&bg_normal, (shades[i]-0.7) * contrast + 0.7, &clearlooks_style->colors.shade[i]);
}
-
+
ge_gdk_color_to_cairo (&style->bg[GTK_STATE_SELECTED], &spot_color);
-
+
ge_shade_color(&spot_color, 1.42, &clearlooks_style->colors.spot[0]);
ge_shade_color(&spot_color, 1.05, &clearlooks_style->colors.spot[1]);
ge_shade_color(&spot_color, 0.65, &clearlooks_style->colors.spot[2]);
-
+
for (i=0; i<5; i++)
{
ge_gdk_color_to_cairo (&style->fg[i], &clearlooks_style->colors.fg[i]);
@@ -1405,7 +1405,7 @@ clearlooks_style_copy (GtkStyle * style, GtkStyle * src)
{
ClearlooksStyle * cl_style = CLEARLOOKS_STYLE (style);
ClearlooksStyle * cl_src = CLEARLOOKS_STYLE (src);
-
+
cl_style->colors = cl_src->colors;
cl_style->menubarstyle = cl_src->menubarstyle;
cl_style->toolbarstyle = cl_src->toolbarstyle;
@@ -1415,7 +1415,7 @@ clearlooks_style_copy (GtkStyle * style, GtkStyle * src)
cl_style->animation = cl_src->animation;
cl_style->radius = cl_src->radius;
cl_style->style = cl_src->style;
-
+
clearlooks_parent_class->copy (style, src);
}
@@ -1508,7 +1508,7 @@ clearlooks_style_draw_layout (GtkStyle * style,
ge_shade_color (&params.parentbg, 1.2, &temp);
else
ge_shade_color (&colors->bg[widget->state], 1.2, &temp);
-
+
etched.red = (int) (temp.r * 65535);
etched.green = (int) (temp.g * 65535);
etched.blue = (int) (temp.b * 65535);
@@ -1550,11 +1550,11 @@ clearlooks_style_draw_render_icon (GtkStyle *style,
* GtkIconSet can be used without a style and if so
* it uses this function.
*/
-
+
base_pixbuf = gtk_icon_source_get_pixbuf (source);
-
+
g_return_val_if_fail (base_pixbuf != NULL, NULL);
-
+
if (widget && gtk_widget_has_screen (widget)) {
screen = gtk_widget_get_screen (widget);
settings = gtk_settings_get_for_screen (screen);
@@ -1566,7 +1566,7 @@ clearlooks_style_draw_render_icon (GtkStyle *style,
GTK_NOTE (MULTIHEAD,
g_warning ("Using the default screen for gtk_default_render_icon()"));
}
-
+
if (size != (GtkIconSize) -1 && !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) {
g_warning (G_STRLOC ": invalid icon size '%d'", size);
@@ -1580,21 +1580,21 @@ clearlooks_style_draw_render_icon (GtkStyle *style,
scaled = scale_or_ref (base_pixbuf, width, height);
else
scaled = g_object_ref (base_pixbuf);
-
+
/* If the state was wildcarded, then generate a state. */
if (gtk_icon_source_get_state_wildcarded (source)) {
if (state == GTK_STATE_INSENSITIVE) {
stated = set_transparency (scaled, 0.3);
gdk_pixbuf_saturate_and_pixelate (stated, stated,
0.1, FALSE);
-
+
g_object_unref (scaled);
} else if (state == GTK_STATE_PRELIGHT) {
stated = gdk_pixbuf_copy (scaled);
-
+
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
1.2, FALSE);
-
+
g_object_unref (scaled);
} else {
stated = scaled;
@@ -1616,7 +1616,7 @@ static void
clearlooks_style_class_init (ClearlooksStyleClass * klass)
{
GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
-
+
clearlooks_style_class = CLEARLOOKS_STYLE_CLASS (klass);
clearlooks_parent_class = g_type_class_peek_parent (klass);
diff --git a/libs/clearlooks-newer/clearlooks_style.h b/libs/clearlooks-newer/clearlooks_style.h
index 78f3ca1675..b306836453 100644
--- a/libs/clearlooks-newer/clearlooks_style.h
+++ b/libs/clearlooks-newer/clearlooks_style.h
@@ -48,7 +48,7 @@ struct _ClearlooksStyle
ClearlooksColors colors;
ClearlooksStyles style;
-
+
guint8 menubarstyle;
guint8 toolbarstyle;
GdkColor scrollbar_color;
diff --git a/libs/clearlooks-newer/clearlooks_types.h b/libs/clearlooks-newer/clearlooks_types.h
index 6559f3c16c..893113cc9e 100644
--- a/libs/clearlooks-newer/clearlooks_types.h
+++ b/libs/clearlooks-newer/clearlooks_types.h
@@ -125,7 +125,7 @@ typedef struct
CairoColor bg[5];
CairoColor base[5];
CairoColor text[5];
-
+
CairoColor shade[9];
CairoColor spot[3];
} ClearlooksColors;
@@ -141,9 +141,9 @@ typedef struct
boolean enable_glow;
gfloat radius;
-
+
ClearlooksStateType state_type;
-
+
uint8 corners;
uint8 xthickness;
uint8 ythickness;
@@ -189,7 +189,7 @@ typedef struct
typedef struct
{
CairoCorners corners;
- ClearlooksShadowType shadow;
+ ClearlooksShadowType shadow;
} ShadowParameters;
typedef struct
@@ -301,7 +301,7 @@ struct _ClearlooksStyleFunctions
const WidgetParameters *widget,
const OptionMenuParameters *optionmenu,
int x, int y, int width, int height);
-
+
void (*draw_inset) (cairo_t *cr,
const CairoColor *bg_color,
double x, double y, double w, double h,
@@ -415,7 +415,7 @@ struct _ClearlooksStyleFunctions
const WidgetParameters *widget,
const ArrowParameters *arrow,
int x, int y, int width, int height);
-
+
void (*draw_checkbox) (cairo_t *cr,
const ClearlooksColors *colors,
const WidgetParameters *widget,
diff --git a/libs/clearlooks-newer/support.c b/libs/clearlooks-newer/support.c
index 6d4d8a286d..c3ac9a8864 100644
--- a/libs/clearlooks-newer/support.c
+++ b/libs/clearlooks-newer/support.c
@@ -49,7 +49,7 @@ void clearlooks_clist_get_header_index (GtkCList *clist, GtkWidget *button,
{
int i;
*columns = clist->columns;
-
+
for (i=0; i<*columns; i++)
{
if (clist->column[i].button == button)
@@ -66,22 +66,22 @@ clearlooks_get_parent_bg (const GtkWidget *widget, CairoColor *color)
GtkStateType state_type;
const GtkWidget *parent;
GdkColor *gcolor;
-
+
if (widget == NULL)
return;
-
+
parent = widget->parent;
-
+
while (parent && GTK_WIDGET_NO_WINDOW (parent) && !((GTK_IS_NOTEBOOK (parent)) || (GTK_IS_TOOLBAR (parent))))
parent = parent->parent;
if (parent == NULL)
return;
-
+
state_type = GTK_WIDGET_STATE (parent);
-
+
gcolor = &parent->style->bg[state_type];
-
+
ge_gdk_color_to_cairo (gcolor, color);
}
@@ -101,12 +101,12 @@ clearlooks_scrollbar_get_stepper (GtkWidget *widget,
check_rectangle.y = widget->allocation.y;
check_rectangle.width = stepper->width;
check_rectangle.height = stepper->height;
-
+
orientation = GTK_RANGE (widget)->orientation;
-
+
if (widget->allocation.x == -1 && widget->allocation.y == -1)
return CL_STEPPER_UNKNOWN;
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = CL_STEPPER_A;
@@ -116,7 +116,7 @@ clearlooks_scrollbar_get_stepper (GtkWidget *widget,
check_rectangle.x = widget->allocation.x + stepper->width;
else
check_rectangle.y = widget->allocation.y + stepper->height;
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = CL_STEPPER_B;
}
@@ -127,7 +127,7 @@ clearlooks_scrollbar_get_stepper (GtkWidget *widget,
check_rectangle.x = widget->allocation.x + widget->allocation.width - (stepper->width * 2);
else
check_rectangle.y = widget->allocation.y + widget->allocation.height - (stepper->height * 2);
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = CL_STEPPER_C;
}
@@ -138,11 +138,11 @@ clearlooks_scrollbar_get_stepper (GtkWidget *widget,
check_rectangle.x = widget->allocation.x + widget->allocation.width - stepper->width;
else
check_rectangle.y = widget->allocation.y + widget->allocation.height - stepper->height;
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = CL_STEPPER_D;
}
-
+
return value;
}
@@ -150,13 +150,13 @@ ClearlooksStepper
clearlooks_scrollbar_visible_steppers (GtkWidget *widget)
{
ClearlooksStepper steppers = 0;
-
+
if (!GE_IS_RANGE (widget))
return 0;
-
+
if (GTK_RANGE (widget)->has_stepper_a)
steppers |= CL_STEPPER_A;
-
+
if (GTK_RANGE (widget)->has_stepper_b)
steppers |= CL_STEPPER_B;
@@ -171,27 +171,27 @@ clearlooks_scrollbar_visible_steppers (GtkWidget *widget)
ClearlooksJunction
clearlooks_scrollbar_get_junction (GtkWidget *widget)
-{
+{
GtkAdjustment *adj;
ClearlooksJunction junction = CL_JUNCTION_NONE;
-
+
if (!GE_IS_RANGE (widget))
return CL_JUNCTION_NONE;
adj = GTK_RANGE (widget)->adjustment;
-
+
if (adj->value <= adj->lower &&
(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b))
{
junction |= CL_JUNCTION_BEGIN;
}
-
+
if (adj->value >= adj->upper - adj->page_size &&
(GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d))
{
junction |= CL_JUNCTION_END;
}
-
+
return junction;
}
@@ -245,7 +245,7 @@ clearlooks_get_notebook_tab_position (GtkWidget *widget,
GtkWidget *tab_label;
gboolean expand;
GtkPackType pack_type;
-
+
tab_child = gtk_notebook_get_nth_page (notebook, i);
/* Skip invisible tabs */
diff --git a/libs/clearlooks-newer/widget-information.c b/libs/clearlooks-newer/widget-information.c
index 0b30c52b72..1a4fe31039 100644
--- a/libs/clearlooks-newer/widget-information.c
+++ b/libs/clearlooks-newer/widget-information.c
@@ -156,7 +156,7 @@ ge_is_bonobo_dock_item (GtkWidget * widget)
result = TRUE;
child = NULL;
}
- }
+ }
if (children)
g_list_free(children);
@@ -278,7 +278,7 @@ ge_button_get_default_border (GtkWidget *widget,
{
GtkBorder default_border = {1, 1, 1, 1};
GtkBorder *tmp_border = NULL;
-
+
if (widget && GE_IS_BUTTON (widget))
gtk_widget_style_get (widget, "default-border", &tmp_border, NULL);
@@ -298,7 +298,7 @@ gboolean
ge_widget_is_ltr (GtkWidget *widget)
{
GtkTextDirection dir = GTK_TEXT_DIR_NONE;
-
+
if (GE_IS_WIDGET (widget))
dir = gtk_widget_get_direction (widget);
diff --git a/libs/clearlooks-older/clearlooks_draw.c b/libs/clearlooks-older/clearlooks_draw.c
index 68bd0e6ee9..cf133eba2f 100644
--- a/libs/clearlooks-older/clearlooks_draw.c
+++ b/libs/clearlooks-older/clearlooks_draw.c
@@ -12,11 +12,11 @@ static void cl_draw_borders (GdkWindow *window, GtkWidget *widget, GtkStyle *sty
static void cl_draw_line (GdkWindow *window, GtkWidget *widget, GtkStyle *style,
int x1, int y1, int x2, int y2, CLBorderType border,
CLRectangle *r);
-
+
static void cl_draw_corner (GdkWindow *window, GtkWidget *widget, GtkStyle *style,
int x, int y, int width, int height,
CLRectangle *r, CLCornerSide corner);
-
+
static void cl_draw_fill (GdkWindow *window, GtkWidget *widget, GtkStyle *style,
int x, int y, int width, int height, CLRectangle *r);
@@ -27,11 +27,11 @@ void cl_draw_rectangle (GdkWindow *window, GtkWidget *widget, GtkStyle *style,
{
cl_draw_fill(window, widget, style, x, y, width, height, r);
}
-
+
if (r->bordergc)
{
cl_draw_borders(window, widget, style, x, y, width, height, r);
- }
+ }
}
@@ -117,10 +117,10 @@ static void cl_draw_line (GdkWindow *window, GtkWidget *widget, GtkStyle *style,
r->gradient_type == CL_GRADIENT_VERTICAL && border == CL_BORDER_TOP)
gdk_gc_set_foreground (r->bordergc, r->border_gradient.from);
else
- gdk_gc_set_foreground (r->bordergc, r->border_gradient.to);
+ gdk_gc_set_foreground (r->bordergc, r->border_gradient.to);
gdk_draw_line (window, r->bordergc, x1, y1, x2, y2);
-
+
gdk_gc_set_foreground (r->bordergc, &tmp_color);
}
}
@@ -142,7 +142,7 @@ static GdkColor *cl_get_gradient_corner_color (CLRectangle *r, CLCornerSide corn
{
color = r->border_gradient.to;
}
-
+
return color;
}
@@ -161,7 +161,7 @@ static void cl_draw_corner (GdkWindow *window, GtkWidget *widget, GtkStyle *styl
if (r->corners[corner] == CL_CORNER_NONE)
return;
-
+
color = cl_get_gradient_corner_color (r, corner);
gdk_gc_get_values (r->bordergc, &values);
@@ -185,21 +185,21 @@ static void cl_draw_corner (GdkWindow *window, GtkWidget *widget, GtkStyle *styl
{
x1 = (corner == CL_CORNER_TOPLEFT ||
corner == CL_CORNER_BOTTOMLEFT) ? x+1 : x+width - 2;
-
+
y1 = (corner == CL_CORNER_TOPLEFT ||
corner == CL_CORNER_TOPRIGHT) ? y+1 : y+height - 2;
-
+
gdk_gc_set_foreground (r->bordergc, color);
gdk_draw_point (window, r->bordergc, x1, y1);
-
+
gdk_gc_set_foreground (r->bordergc, &aacolor);
-
+
x1 = (corner == CL_CORNER_TOPLEFT ||
corner == CL_CORNER_BOTTOMLEFT) ? x+1 : x+width-2;
y1 = (corner == CL_CORNER_TOPLEFT ||
- corner == CL_CORNER_TOPRIGHT) ? y : y+height-1;
-
+ corner == CL_CORNER_TOPRIGHT) ? y : y+height-1;
+
gdk_draw_point (window, r->bordergc, x1, y1);
x1 = (corner == CL_CORNER_TOPLEFT ||
@@ -209,7 +209,7 @@ static void cl_draw_corner (GdkWindow *window, GtkWidget *widget, GtkStyle *styl
corner == CL_CORNER_TOPRIGHT) ? y+1 : y+height-2;
gdk_draw_point (window, r->bordergc, x1, y1);
-
+
}
else if (r->corners[corner] == CL_CORNER_NARROW)
{
@@ -218,7 +218,7 @@ static void cl_draw_corner (GdkWindow *window, GtkWidget *widget, GtkStyle *styl
y1 = (corner == CL_CORNER_TOPLEFT ||
corner == CL_CORNER_TOPRIGHT) ? y : y+height-1;
-
+
gdk_gc_set_foreground (r->bordergc, &aacolor);
gdk_draw_point (window, r->bordergc, x1, y1);
}
@@ -258,8 +258,8 @@ void cl_rectangle_set_button(CLRectangle *r, GtkStyle *style,
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
int my_state_type = (state_type == GTK_STATE_ACTIVE) ? 2 : 0;
GdkGC *border_gc = clearlooks_style->border_gc[CL_BORDER_UPPER+my_state_type];
-
-
+
+
cl_rectangle_init (r, style->bg_gc[state_type],
clearlooks_style->border_gc[CL_BORDER_UPPER+my_state_type],
tl, tr, bl, br);
@@ -279,9 +279,9 @@ void cl_rectangle_set_button(CLRectangle *r, GtkStyle *style,
r->topleft = (state_type != GTK_STATE_ACTIVE) ? style->light_gc[state_type] : clearlooks_style->shade_gc[4];
r->bottomright = (state_type != GTK_STATE_ACTIVE) ? clearlooks_style->shade_gc[1] : NULL;
-
+
shade (&style->bg[state_type], &r->tmp_color, 0.93);
-
+
cl_rectangle_set_gradient (&r->fill_gradient,
&style->bg[state_type],
@@ -296,21 +296,21 @@ void cl_rectangle_set_entry (CLRectangle *r, GtkStyle *style,
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
GdkGC *bordergc;
-
+
if (has_focus)
bordergc = clearlooks_style->spot3_gc;
else if (state_type != GTK_STATE_INSENSITIVE)
bordergc = clearlooks_style->border_gc[CL_BORDER_LOWER];
else
- bordergc = clearlooks_style->shade_gc[3];
-
+ bordergc = clearlooks_style->shade_gc[3];
+
cl_rectangle_init (r, style->base_gc[state_type], bordergc,
tl, tr, bl, br);
if (state_type != GTK_STATE_INSENSITIVE )
r->topleft = (has_focus) ? clearlooks_style->spot1_gc
: style->bg_gc[GTK_STATE_NORMAL];
-
+
if (has_focus)
r->bottomright = clearlooks_style->spot1_gc;
else if (state_type == GTK_STATE_INSENSITIVE)
@@ -328,24 +328,24 @@ void cl_draw_shadow(GdkWindow *window, GtkWidget *widget, GtkStyle *style,
x1 = x+1+(r->corners[CL_CORNER_BOTTOMLEFT]/2);
y1 = y2 = y+height-2;
x2 = x+width - 1 - (1+r->corners[CL_CORNER_BOTTOMRIGHT]/2);
-
+
gdk_draw_line (window, r->bottomright, x1, y1, x2, y2);
-
+
x1 = x2 = x+width-2;
y1 = y+1+(r->corners[CL_CORNER_TOPRIGHT]/2);
y2 = y+height - 1 - (1+r->corners[CL_CORNER_BOTTOMRIGHT]/2);
gdk_draw_line (window, r->bottomright, x1, y1, x2, y2);
}
-
+
if (r->topleft != NULL)
{
x1 = x+1+(r->corners[CL_CORNER_TOPLEFT]/2);
y1 = y2 = y+1;
x2 = x+width-1-(1+r->corners[CL_CORNER_TOPRIGHT]/2);
-
+
gdk_draw_line (window, r->topleft, x1, y1, x2, y2);
-
+
x1 = x2 = x+1;
y1 = y+1+(r->corners[CL_CORNER_TOPLEFT]/2);
y2 = y+height-1-(1+r->corners[CL_CORNER_BOTTOMLEFT]/2);
@@ -371,16 +371,16 @@ void cl_rectangle_init (CLRectangle *r,
int tl, int tr, int bl, int br)
{
r->gradient_type = CL_GRADIENT_NONE;
-
+
r->border_gradient.from = r->border_gradient.to = NULL;
r->fill_gradient.from = r->fill_gradient.to = NULL;
-
+
r->fillgc = fillgc;
r->bordergc = bordergc;
-
+
r->topleft = NULL;
r->bottomright = NULL;
-
+
r->corners[CL_CORNER_TOPLEFT] = tl;
r->corners[CL_CORNER_TOPRIGHT] = tr;
r->corners[CL_CORNER_BOTTOMLEFT] = bl;
@@ -392,7 +392,7 @@ void cl_rectangle_set_corners (CLRectangle *r, int tl, int tr, int bl, int br)
r->corners[CL_CORNER_TOPLEFT] = tl;
r->corners[CL_CORNER_TOPRIGHT] = tr;
r->corners[CL_CORNER_BOTTOMLEFT] = bl;
- r->corners[CL_CORNER_BOTTOMRIGHT] = br;
+ r->corners[CL_CORNER_BOTTOMRIGHT] = br;
}
void cl_set_corner_sharpness (const gchar *detail, GtkWidget *widget, CLRectangle *r)
@@ -402,7 +402,7 @@ void cl_set_corner_sharpness (const gchar *detail, GtkWidget *widget, CLRectangl
gboolean rtl = get_direction (widget->parent) == GTK_TEXT_DIR_RTL;
int cl = rtl ? CL_CORNER_ROUND : CL_CORNER_NONE;
int cr = rtl ? CL_CORNER_NONE : CL_CORNER_ROUND;
-
+
cl_rectangle_set_corners (r, cl, cr, cl, cr);
}
else if (detail && !strcmp (detail, "spinbutton_up"))
@@ -434,25 +434,25 @@ void cl_rectangle_set_clip_rectangle (CLRectangle *r, GdkRectangle *area)
{
if (area == NULL)
return;
-
+
if (r->fillgc)
gdk_gc_set_clip_rectangle (r->fillgc, area);
-
+
if (r->bordergc)
- gdk_gc_set_clip_rectangle (r->bordergc, area);
+ gdk_gc_set_clip_rectangle (r->bordergc, area);
if (r->topleft)
- gdk_gc_set_clip_rectangle (r->topleft, area);
+ gdk_gc_set_clip_rectangle (r->topleft, area);
if (r->bottomright)
- gdk_gc_set_clip_rectangle (r->bottomright, area);
+ gdk_gc_set_clip_rectangle (r->bottomright, area);
}
void cl_rectangle_reset_clip_rectangle (CLRectangle *r)
{
if (r->fillgc)
gdk_gc_set_clip_rectangle (r->fillgc, NULL);
-
+
if (r->bordergc)
gdk_gc_set_clip_rectangle (r->bordergc, NULL);
@@ -494,37 +494,37 @@ GdkPixmap* cl_progressbar_tile_new (GdkDrawable *drawable, GtkWidget *widget,
int trans;
int stripe_width = height/2;
- int topright = height + stripe_width;
+ int topright = height + stripe_width;
int topright_div_2 = topright/2;
- double shift;
+ double shift;
GdkPoint points[4];
GtkProgressBarOrientation orientation = gtk_progress_bar_get_orientation (GTK_PROGRESS_BAR (widget));
gboolean is_horizontal = (orientation == GTK_PROGRESS_LEFT_TO_RIGHT || orientation == GTK_PROGRESS_RIGHT_TO_LEFT) ? 1 : 0;
-
+
GdkPixmap *tmp = gdk_pixmap_new (widget->window, width, height, -1);
GdkColor tmp_color;
shade (&clearlooks_style->spot2, &tmp_color, 0.90);
-
+
if (is_horizontal)
draw_hgradient (tmp, style->black_gc, style, 0, 0, width, height,
&clearlooks_style->spot2, &tmp_color );
else
draw_vgradient (tmp, style->black_gc, style, 0, 0, width, height,
&tmp_color, &clearlooks_style->spot2); /* TODO: swap for RTL */
-
+
if (orientation == GTK_PROGRESS_RIGHT_TO_LEFT ||
orientation == GTK_PROGRESS_BOTTOM_TO_TOP)
{
offset = -offset;
xdir = -1;
}
-
+
if (get_direction (widget) == GTK_TEXT_DIR_RTL)
offset = -offset;
-
+
if (is_horizontal)
{
points[0] = (GdkPoint){xdir*(topright - stripe_width - topright_div_2), 0}; /* topleft */
@@ -539,11 +539,11 @@ GdkPixmap* cl_progressbar_tile_new (GdkDrawable *drawable, GtkWidget *widget,
points[2] = (GdkPoint){0, xdir*(stripe_width - topright_div_2)}; /* bottomright */
points[3] = (GdkPoint){0, xdir*(-topright_div_2)}; /* bottomleft */
}
-
-
+
+
shift = (stripe_width*2)/(double)10;
cl_progressbar_points_transform (points, 4, (offset*shift), is_horizontal);
-
+
trans = (width/2)-1-(stripe_width*2);
cl_progressbar_points_transform (points, 4, trans, is_horizontal);
gdk_draw_polygon (tmp, clearlooks_style->spot2_gc, TRUE, points, 4);
@@ -557,7 +557,7 @@ GdkPixmap* cl_progressbar_tile_new (GdkDrawable *drawable, GtkWidget *widget,
trans = (width/2)-1+(stripe_width*2);
cl_progressbar_points_transform (points, 4, trans, is_horizontal);
gdk_draw_polygon (tmp, clearlooks_style->spot2_gc, TRUE, points, 4);
-
+
return tmp;
}
@@ -576,9 +576,9 @@ void cl_progressbar_fill (GdkDrawable *drawable, GtkWidget *widget,
ny = y,
nwidth = height,
nheight = width;
-
+
gdk_gc_set_clip_rectangle (gc, area);
-
+
switch (orientation)
{
case GTK_PROGRESS_LEFT_TO_RIGHT:
@@ -648,9 +648,9 @@ void cl_progressbar_fill (GdkDrawable *drawable, GtkWidget *widget,
break;
}
}
-
+
gdk_gc_set_clip_rectangle (gc, NULL);
-
+
g_object_unref (tile);
}
@@ -664,7 +664,7 @@ GdkColor cl_gc_set_fg_color_shade (GdkGC *gc, GdkColormap *colormap,
gdk_gc_get_values (gc, &values);
gdk_rgb_find_color (colormap, &tmp_color);
gdk_gc_set_foreground (gc, &tmp_color);
-
+
return values.foreground;
}
@@ -675,10 +675,10 @@ static void cl_get_window_style_state (GtkWidget *widget, GtkStyle **style, GtkS
GtkStyle *windowstyle = NULL;
GtkWidget *tmpwidget = widget;
GtkStateType windowstate;
-
+
if (widget && GTK_IS_ENTRY (widget))
tmpwidget = tmpwidget->parent;
-
+
while (tmpwidget && GTK_WIDGET_NO_WINDOW (tmpwidget) && !GTK_IS_NOTEBOOK(tmpwidget))
{
tmpwidget = tmpwidget->parent;
@@ -692,9 +692,9 @@ static GdkGC *cl_get_window_bg_gc (GtkWidget *widget)
{
GtkStyle *style;
GtkStateType state_type;
-
+
cl_get_window_style_state (widget, &style, &state_type);
-
+
return style->bg_gc[state_type];
}
@@ -709,18 +709,18 @@ void cl_draw_inset (GtkStyle *style, GdkWindow *window, GtkWidget *widget,
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE(style);
ClearlooksStyle *clwindowstyle; /* style of the window this widget is on */
- GtkStateType windowstate;
+ GtkStateType windowstate;
CLRectangle r;
cl_rectangle_init (&r, NULL, style->black_gc,
tl, tr, bl, br);
-
+
r.gradient_type = CL_GRADIENT_VERTICAL;
-
+
cl_get_window_style_state(widget, (GtkStyle**)&clwindowstyle, &windowstate);
-
+
g_assert (clwindowstyle != NULL);
-
+
if (GTK_WIDGET_HAS_DEFAULT (widget))
{
r.bordergc = style->mid_gc[GTK_STATE_NORMAL];
@@ -748,16 +748,16 @@ void cl_draw_button(GtkStyle *style, GdkWindow *window,
GdkGC *bg_gc = NULL;
gboolean is_active = FALSE;
CLRectangle r;
-
+
/* Get the background color of the window we're on */
bg_gc = cl_get_window_bg_gc(widget);
-
+
cl_rectangle_set_button (&r, style, state_type,
GTK_WIDGET_HAS_DEFAULT (widget),
GTK_WIDGET_HAS_FOCUS (widget),
CL_CORNER_ROUND, CL_CORNER_ROUND,
CL_CORNER_ROUND, CL_CORNER_ROUND);
-
+
if (state_type == GTK_STATE_ACTIVE)
is_active = TRUE;
@@ -768,24 +768,24 @@ void cl_draw_button(GtkStyle *style, GdkWindow *window,
cl_rectangle_set_gradient (&r.fill_gradient, &clearlooks_style->shade[1], &clearlooks_style->shade[1]);
r.topleft = clearlooks_style->shade_gc[3];
r.bottomright = clearlooks_style->shade_gc[1];
-
+
is_active = TRUE;
- }
+ }
if (!is_active)
r.fillgc = NULL;
-
+
if (!GTK_IS_NOTEBOOK (widget->parent))
{
gdk_draw_rectangle (window, bg_gc, FALSE, x, y, width-1, height-1);
-
+
/* Draw "sunken" look when border thickness is more than 2 pixels. */
if (style->xthickness > 2 && style->ythickness > 2)
cl_draw_inset (style, window, widget, area, x, y, width, height,
CL_CORNER_ROUND, CL_CORNER_ROUND,
CL_CORNER_ROUND, CL_CORNER_ROUND);
}
-
+
/* Draw "sunken" look when border thickness is more than 2 pixels.*/
if (style->xthickness > 2 && style->ythickness > 2)
{
@@ -794,37 +794,37 @@ void cl_draw_button(GtkStyle *style, GdkWindow *window,
height-=2;
width-=2;
}
-
+
/* Don't draw the normal gradient for normal buttons. */
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
-
-
+
+
if (!is_active)
{
int tmp_height = (float)height*0.25;
-
+
gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x+2,y+2,width-4,tmp_height,
&clearlooks_style->button_g1[state_type],
&clearlooks_style->button_g2[state_type]);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x+2, y+2+tmp_height, width-4, height-3-tmp_height*2,
&clearlooks_style->button_g2[state_type],
&clearlooks_style->button_g3[state_type]);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x+2,y+height-tmp_height-1,width-4,tmp_height,
&clearlooks_style->button_g3[state_type],
&clearlooks_style->button_g4[state_type]);
gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
- }
-
+ }
+
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
}
@@ -840,21 +840,21 @@ void cl_draw_spinbutton(GtkStyle *style, GdkWindow *window,
GdkRectangle new_area;
int tl = CL_CORNER_NONE, tr = CL_CORNER_NONE,
- bl = CL_CORNER_NONE, br = CL_CORNER_NONE;
-
+ bl = CL_CORNER_NONE, br = CL_CORNER_NONE;
+
if (area == NULL)
{
new_area.x = x;
new_area.y = y;
new_area.width = width;
new_area.height = height;
- area = &new_area;
+ area = &new_area;
}
if (!strcmp (detail, "spinbutton")) /* draws the 'back' of the spinbutton */
{
GdkGC *bg_gc = cl_get_window_bg_gc(widget);
-
+
gdk_gc_set_clip_rectangle (bg_gc, area);
gdk_draw_rectangle (window, bg_gc, FALSE, x, y, width-1, height-1);
gdk_gc_set_clip_rectangle (bg_gc, NULL);
@@ -863,32 +863,32 @@ void cl_draw_spinbutton(GtkStyle *style, GdkWindow *window,
cl_draw_inset (style, window, widget, area, x, y, width, height,
CL_CORNER_NONE, CL_CORNER_ROUND,
CL_CORNER_NONE, CL_CORNER_ROUND);
-
+
return;
}
if (!strcmp (detail, "spinbutton_up"))
{
tr = CL_CORNER_ROUND;
-
+
(style->xthickness > 2 && style->ythickness > 2) ? y++ : height++;
}
-
+
if (!strcmp (detail, "spinbutton_down"))
{
br = CL_CORNER_ROUND;
-
+
if (style->xthickness > 2 && style->ythickness > 2)
height--;
}
-
+
cl_rectangle_set_button (&r, style, state_type,
GTK_WIDGET_HAS_DEFAULT (widget),
GTK_WIDGET_HAS_FOCUS (widget),
tl, tr,
bl, br);
width--;
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
@@ -902,15 +902,15 @@ void cl_draw_combobox_entry (GtkStyle *style, GdkWindow *window,
gint x, gint y, gint width, gint height)
{
CLRectangle r;
-
+
gboolean rtl = get_direction (widget->parent) == GTK_TEXT_DIR_RTL;
gboolean has_focus = GTK_WIDGET_HAS_FOCUS (widget);
-
+
int cl = rtl ? CL_CORNER_NONE : CL_CORNER_ROUND,
cr = rtl ? CL_CORNER_ROUND : CL_CORNER_NONE;
-
+
GdkGC *bg_gc = cl_get_window_bg_gc(widget);
-
+
if (rtl)
{
if (!has_focus)
@@ -924,7 +924,7 @@ void cl_draw_combobox_entry (GtkStyle *style, GdkWindow *window,
width += 2;
if (has_focus) width--; /* this gives us a 2px focus line at the right side. */
}
-
+
cl_rectangle_set_entry (&r, style, state_type,
cl, cr, cl, cr,
has_focus);
@@ -944,12 +944,12 @@ void cl_draw_combobox_entry (GtkStyle *style, GdkWindow *window,
width-=2;
height-=2;
}
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
-
+
cl_rectangle_reset_clip_rectangle (&r);
}
@@ -969,16 +969,16 @@ void cl_draw_combobox_button (GtkStyle *style, GdkWindow *window,
GTK_WIDGET_HAS_FOCUS (widget),
CL_CORNER_NONE, CL_CORNER_ROUND,
CL_CORNER_NONE, CL_CORNER_ROUND);
-
+
if (state_type == GTK_STATE_ACTIVE)
is_active = TRUE;
else
r.fillgc = NULL;
-
+
/* Seriously, why can't non-gtk-apps at least try to be decent citizens?
Take this fscking OpenOffice.org 1.9 for example. The morons responsible
for this utter piece of crap give the clip size wrong values! :'( */
-
+
if (area)
{
area->x = x;
@@ -989,20 +989,20 @@ void cl_draw_combobox_button (GtkStyle *style, GdkWindow *window,
x--;
width++;
-
+
/* Draw "sunken" look when border thickness is more than 2 pixels. */
if (GTK_IS_COMBO(widget->parent))
draw_inset = (widget->parent->style->xthickness > 2 &&
widget->parent->style->ythickness > 2);
else
draw_inset = (style->xthickness > 2 && style->ythickness > 2);
-
+
if (draw_inset)
{
cl_draw_inset (style, window, widget, area, x, y, width, height,
CL_CORNER_NONE, CL_CORNER_ROUND,
CL_CORNER_NONE, CL_CORNER_ROUND);
-
+
x++;
y++;
height-=2;
@@ -1013,36 +1013,36 @@ void cl_draw_combobox_button (GtkStyle *style, GdkWindow *window,
x++;
width--;
}
-
+
if (area)
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
-
+
if (!is_active)
{
int tmp_height = (float)height*0.25;
-
+
gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x+2,y+2,width-4,tmp_height,
&clearlooks_style->button_g1[state_type],
&clearlooks_style->button_g2[state_type]);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x+2, y+2+tmp_height, width-4, height-3-tmp_height*2,
&clearlooks_style->button_g2[state_type],
&clearlooks_style->button_g3[state_type]);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x+2,y+height-tmp_height-1,width-4,tmp_height,
&clearlooks_style->button_g3[state_type],
&clearlooks_style->button_g4[state_type]);
gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
- }
-
+ }
+
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
if (area)
@@ -1059,31 +1059,31 @@ void cl_draw_entry (GtkStyle *style, GdkWindow *window,
CLRectangle r;
gboolean has_focus = GTK_WIDGET_HAS_FOCUS(widget);
GdkGC *bg_gc = cl_get_window_bg_gc(widget);
-
+
gdk_draw_rectangle (window, bg_gc, FALSE, x, y, width-1, height-1);
gtk_style_apply_default_background (style, window, TRUE, state_type,
area, x+1, y+1, width-2, height-2);
-
+
cl_rectangle_set_entry (&r, style, state_type,
CL_CORNER_ROUND, CL_CORNER_ROUND,
CL_CORNER_ROUND, CL_CORNER_ROUND,
has_focus);
-
+
/* Draw "sunken" look when border thickness is more than 2 pixels. */
if (style->xthickness > 2 && style->ythickness > 2)
{
cl_draw_inset (style, window, widget, area, x, y, width, height,
CL_CORNER_ROUND, CL_CORNER_ROUND,
CL_CORNER_ROUND, CL_CORNER_ROUND);
-
+
x++;
y++;
width-=2;
height-=2;
}
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
@@ -1102,14 +1102,14 @@ void cl_draw_optionmenu(GtkStyle *style, GdkWindow *window,
int line_pos;
option_menu_get_props (widget, &indicator_size, &indicator_spacing);
-
+
if (get_direction (widget) == GTK_TEXT_DIR_RTL)
line_pos = x + (indicator_size.width + indicator_spacing.left + indicator_spacing.right) + style->xthickness;
else
line_pos = x + width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - style->xthickness;
cl_draw_button (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
-
+
gdk_draw_line (window, clearlooks_style->shade_gc[3],
line_pos, y + style->ythickness - 1, line_pos,
y + height - style->ythickness);
@@ -1130,7 +1130,7 @@ void cl_draw_menuitem_button (GdkDrawable *window, GtkWidget *widget, GtkStyle *
GdkColor lower_color;
shade (&style->base[GTK_STATE_SELECTED], &lower_color, 0.85);
-
+
if (menubar)
{
height++;
@@ -1141,17 +1141,17 @@ void cl_draw_menuitem_button (GdkDrawable *window, GtkWidget *widget, GtkStyle *
{
r->bordergc = clearlooks_style->spot3_gc;
}
-
+
cl_rectangle_set_corners (r, corner, corner, corner, corner);
-
+
cl_rectangle_set_gradient (&r->fill_gradient,
&style->base[GTK_STATE_SELECTED], &lower_color);
r->gradient_type = CL_GRADIENT_VERTICAL;
-
+
r->fillgc = clearlooks_style->spot2_gc;
r->topleft = clearlooks_style->spot1_gc;
-
+
cl_rectangle_set_clip_rectangle (r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, r);
cl_draw_shadow (window, widget, style, x, y, width, height, r);
@@ -1165,22 +1165,22 @@ void cl_draw_menuitem_flat (GdkDrawable *window, GtkWidget *widget, GtkStyle *st
ClearlooksStyle *clearlooks_style = (ClearlooksStyle*)style;
gboolean menubar = (widget->parent && GTK_IS_MENU_BAR(widget->parent)) ? TRUE : FALSE;
GdkColor tmp;
-
+
cl_rectangle_set_corners (r, CL_CORNER_NARROW, CL_CORNER_NARROW,
CL_CORNER_NARROW, CL_CORNER_NARROW);
-
+
tmp = cl_gc_set_fg_color_shade (style->black_gc, style->colormap,
&style->base[GTK_STATE_PRELIGHT], 0.8);
r->bordergc = style->black_gc;
r->fillgc = style->base_gc[GTK_STATE_PRELIGHT];
-
+
if (menubar) height++;
cl_rectangle_set_clip_rectangle (r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, r);
- cl_rectangle_reset_clip_rectangle (r);
-
+ cl_rectangle_reset_clip_rectangle (r);
+
gdk_gc_set_foreground (style->black_gc, &tmp);
}
@@ -1192,29 +1192,29 @@ void cl_draw_menuitem_gradient (GdkDrawable *window, GtkWidget *widget, GtkStyle
gboolean menubar = (widget->parent && GTK_IS_MENU_BAR(widget->parent)) ? TRUE : FALSE;
GdkColor tmp;
GdkColor lower_color;
-
+
shade (&style->base[GTK_STATE_SELECTED], &lower_color, 0.8);
-
+
cl_rectangle_set_corners (r, CL_CORNER_NARROW, CL_CORNER_NARROW,
CL_CORNER_NARROW, CL_CORNER_NARROW);
-
+
cl_rectangle_set_gradient (&r->fill_gradient,
&style->base[GTK_STATE_SELECTED], &lower_color);
r->gradient_type = CL_GRADIENT_VERTICAL;
-
+
tmp = cl_gc_set_fg_color_shade (style->black_gc, style->colormap,
&style->base[GTK_STATE_PRELIGHT], 0.8);
r->bordergc = style->black_gc;
r->fillgc = style->base_gc[GTK_STATE_PRELIGHT];
-
+
if (menubar) height++;
cl_rectangle_set_clip_rectangle (r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, r);
cl_rectangle_reset_clip_rectangle (r);
-
+
gdk_gc_set_foreground (style->black_gc, &tmp);
}
@@ -1228,12 +1228,12 @@ void cl_draw_treeview_header (GtkStyle *style, GdkWindow *window,
gint columns = 0, column_index = -1, fill_width = width;
gboolean is_etree = strcmp("ETree", G_OBJECT_TYPE_NAME(widget->parent)) == 0;
gboolean resizable = TRUE;
-
+
GdkGC *bottom = clearlooks_style->shade_gc[5];
-
+
if ( width < 2 || height < 2 )
return;
-
+
if (GTK_IS_TREE_VIEW (widget->parent))
{
gtk_treeview_get_header_index (GTK_TREE_VIEW(widget->parent),
@@ -1245,20 +1245,20 @@ void cl_draw_treeview_header (GtkStyle *style, GdkWindow *window,
gtk_clist_get_header_index (GTK_CLIST(widget->parent),
widget, &column_index, &columns);
}
-
+
if (area)
{
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], area);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[4], area);
- gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
+ gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[5], area);
}
-
+
if (state_type != GTK_STATE_NORMAL)
fill_width-=2;
-
+
gdk_draw_rectangle (window, style->bg_gc[state_type], TRUE, x, y, fill_width, height-(height/3)+1);
-
+
draw_hgradient (window, style->bg_gc[state_type], style,
x, 1+y+height-(height/3), fill_width, height/3,
&style->bg[state_type], &clearlooks_style->inset_dark[state_type]);
@@ -1268,26 +1268,26 @@ void cl_draw_treeview_header (GtkStyle *style, GdkWindow *window,
gdk_draw_line (window, clearlooks_style->shade_gc[4], x+width-2, y+4, x+width-2, y+height-5);
gdk_draw_line (window, clearlooks_style->shade_gc[0], x+width-1, y+4, x+width-1, y+height-5);
}
-
+
/* left light line */
if (column_index == 0)
gdk_draw_line (window, clearlooks_style->shade_gc[0], x, y+1, x, y+height-2);
-
+
/* top light line */
gdk_draw_line (window, clearlooks_style->shade_gc[0], x, y, x+width-1, y);
-
+
/* bottom dark line */
if (state_type == GTK_STATE_INSENSITIVE)
bottom = clearlooks_style->shade_gc[3];
-
-
+
+
gdk_draw_line (window, bottom, x, y+height-1, x+width-1, y+height-1);
-
+
if (area)
{
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], NULL);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[4], NULL);
gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[5], NULL);
- }
+ }
}
diff --git a/libs/clearlooks-older/clearlooks_draw.h b/libs/clearlooks-older/clearlooks_draw.h
index 0605cba1f9..eb707db6c0 100644
--- a/libs/clearlooks-older/clearlooks_draw.h
+++ b/libs/clearlooks-older/clearlooks_draw.h
@@ -21,17 +21,17 @@ typedef struct
{
CLGradient fill_gradient;
CLGradient border_gradient;
-
+
CLGradientType gradient_type;
-
+
GdkGC *bordergc;
GdkGC *fillgc;
guint8 corners[4];
-
+
GdkGC *topleft; /* top + left shadow */
GdkGC *bottomright; /* bottom + right shadow */
-
+
GdkColor tmp_color; /* used for gradient */
} CLRectangle;
@@ -79,7 +79,7 @@ void cl_rectangle_set_entry (CLRectangle *r, GtkStyle *style,
CLBorderType tl, CLBorderType tr,
CLBorderType bl, CLBorderType br,
gboolean has_focus);
-
+
void cl_draw_shadow(GdkWindow *window, GtkWidget *widget, GtkStyle *style,
int x, int y, int width, int height, CLRectangle *r);
@@ -99,12 +99,12 @@ void cl_rectangle_reset (CLRectangle *r, GtkStyle *style);
GdkPixmap* cl_progressbar_tile_new (GdkDrawable *drawable, GtkWidget *widget,
GtkStyle *style, gint height, gint offset);
-
+
void cl_progressbar_fill (GdkDrawable *drawable, GtkWidget *widget,
GtkStyle *style, GdkGC *gc,
gint x, gint y, gint width, gint height,
guint8 offset, GdkRectangle *area);
-
+
GdkColor cl_gc_set_fg_color_shade (GdkGC *gc, GdkColormap *colormap,
GdkColor *from, gfloat s);
@@ -113,31 +113,31 @@ void cl_draw_spinbutton(GtkStyle *style, GdkWindow *window,
GdkRectangle *area,
GtkWidget *widget, const gchar *detail,
gint x, gint y, gint width, gint height);
-
+
void cl_draw_button(GtkStyle *style, GdkWindow *window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget, const gchar *detail,
gint x, gint y, gint width, gint height);
-
+
void cl_draw_entry (GtkStyle *style, GdkWindow *window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget, const gchar *detail,
gint x, gint y, gint width, gint height);
-
+
void cl_draw_combobox_entry (GtkStyle *style, GdkWindow *window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget, const gchar *detail,
gint x, gint y, gint width, gint height);
-
+
void cl_draw_combobox_button (GtkStyle *style, GdkWindow *window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget, const gchar *detail,
gint x, gint y, gint width, gint height);
-
+
void cl_draw_menuitem_button (GdkDrawable *window, GtkWidget *widget, GtkStyle *style,
GdkRectangle *area, GtkStateType state_type,
int x, int y, int wiidth, int height, CLRectangle *r);
@@ -149,11 +149,11 @@ void cl_draw_menuitem_flat (GdkDrawable *window, GtkWidget *widget, GtkStyle *st
void cl_draw_menuitem_gradient (GdkDrawable *window, GtkWidget *widget, GtkStyle *style,
GdkRectangle *area, GtkStateType state_type,
int x, int y, int wiidth, int height, CLRectangle *r);
-
+
void cl_draw_treeview_header (GtkStyle *style, GdkWindow *window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget, const gchar *detail,
gint x, gint y, gint width, gint height);
-
+
#endif /* CLEARLOOKS_DRAW_H */
diff --git a/libs/clearlooks-older/clearlooks_rc_style.c b/libs/clearlooks-older/clearlooks_rc_style.c
index f3af2044fe..639edbabb7 100644
--- a/libs/clearlooks-older/clearlooks_rc_style.c
+++ b/libs/clearlooks-older/clearlooks_rc_style.c
@@ -251,20 +251,20 @@ theme_parse_listviewitemstyle(GtkSettings *settings,
guint8 *listviewitemstyle)
{
guint token;
-
+
token = g_scanner_get_next_token(scanner);
-
+
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_EQUAL_SIGN)
return G_TOKEN_EQUAL_SIGN;
-
+
token = g_scanner_get_next_token(scanner);
if (token != G_TOKEN_INT)
return G_TOKEN_INT;
-
+
*listviewitemstyle = scanner->value.v_int;
-
+
return G_TOKEN_NONE;
}
@@ -272,7 +272,7 @@ static guint
clearlooks_rc_style_parse (GtkRcStyle *rc_style,
GtkSettings *settings,
GScanner *scanner)
-
+
{
static GQuark scope_id = 0;
ClearlooksRcStyle *clearlooks_style = CLEARLOOKS_RC_STYLE (rc_style);
@@ -359,15 +359,15 @@ clearlooks_rc_style_merge (GtkRcStyle *dest,
GtkRcStyle *src)
{
ClearlooksRcStyle *dest_w, *src_w;
-
+
parent_class->merge (dest, src);
-
+
if (!CLEARLOOKS_IS_RC_STYLE (src))
return;
-
+
src_w = CLEARLOOKS_RC_STYLE (src);
dest_w = CLEARLOOKS_RC_STYLE (dest);
-
+
dest_w->contrast = src_w->contrast;
dest_w->sunkenmenubar = src_w->sunkenmenubar;
dest_w->progressbarstyle = src_w->progressbarstyle;
diff --git a/libs/clearlooks-older/clearlooks_style.c b/libs/clearlooks-older/clearlooks_style.c
index 29cc30dd9b..da4720ed56 100644
--- a/libs/clearlooks-older/clearlooks_style.c
+++ b/libs/clearlooks-older/clearlooks_style.c
@@ -43,7 +43,7 @@ static void cl_progressbar_remove (gpointer data)
progressbars = g_list_remove (progressbars, data);
g_object_unref (data);
-
+
if (g_list_first(progressbars) == NULL) {
g_source_remove(timer_id);
timer_id = 0;
@@ -58,11 +58,11 @@ static void update_progressbar (gpointer data, gpointer user_data)
return;
fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (data));
-
+
/* update only if not filled */
if (fraction < 1.0)
gtk_widget_queue_resize ((GtkWidget*)data);
-
+
if (fraction >= 1.0 || GTK_PROGRESS (data)->activity_mode)
cl_progressbar_remove (data);
}
@@ -89,7 +89,7 @@ static void cl_progressbar_add (gpointer data)
g_object_ref (data);
g_signal_connect ((GObject*)data, "unrealize", G_CALLBACK (cl_progressbar_remove), data);
-
+
if (timer_id == 0)
timer_id = g_timeout_add (100, timer_func, NULL);
}
@@ -98,7 +98,7 @@ static GdkColor *
clearlooks_get_spot_color (ClearlooksRcStyle *clearlooks_rc)
{
GtkRcStyle *rc = GTK_RC_STYLE (clearlooks_rc);
-
+
if (clearlooks_rc->has_spot_color)
return &clearlooks_rc->spot_color;
else
@@ -128,12 +128,12 @@ draw_tab (GtkStyle *style,
GtkRequisition indicator_size;
GtkBorder indicator_spacing;
gint arrow_height;
-
+
option_menu_get_props (widget, &indicator_size, &indicator_spacing);
-
+
indicator_size.width += (indicator_size.width % 2) - 1;
arrow_height = indicator_size.width / 2 + 2;
-
+
x += (width - indicator_size.width) / 2;
y += height/2;
@@ -147,11 +147,11 @@ draw_tab (GtkStyle *style,
GTK_ARROW_DOWN, 1+x, 1+y+1,
indicator_size.width, arrow_height);
}
-
+
draw_arrow (window, style->fg_gc[state_type], area,
GTK_ARROW_UP, x, y-arrow_height,
indicator_size.width, arrow_height);
-
+
draw_arrow (window, style->fg_gc[state_type], area,
GTK_ARROW_DOWN, x, y+1,
indicator_size.width, arrow_height);
@@ -175,9 +175,9 @@ clearlooks_draw_arrow (GtkStyle *style,
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
gint original_width, original_x;
GdkGC *gc;
-
+
sanitize_size (window, &width, &height);
-
+
if (is_combo_box (widget))
{
width = 7;
@@ -194,57 +194,57 @@ clearlooks_draw_arrow (GtkStyle *style,
GTK_ARROW_DOWN, 1+x, 1+y+1,
width, height);
}
-
+
draw_arrow (window, style->fg_gc[state], area,
GTK_ARROW_UP, x, y-height,
width, height);
-
+
draw_arrow (window, style->fg_gc[state], area,
GTK_ARROW_DOWN, x, y+1,
width, height);
-
+
return;
}
-
+
original_width = width;
original_x = x;
-
+
/* Make spinbutton arrows and arrows in menus
* slightly larger to get the right pixels drawn */
if (DETAIL ("spinbutton"))
height += 1;
-
+
if (DETAIL("menuitem"))
{
width = 6;
height = 7;
}
-
+
/* Compensate arrow position for "sunken" look */
if (DETAIL ("spinbutton") && arrow_type == GTK_ARROW_DOWN &&
style->xthickness > 2 && style->ythickness > 2)
y -= 1;
-
+
if (widget && widget->parent && GTK_IS_COMBO (widget->parent->parent))
{
width -= 2;
height -=2;
x++;
}
-
+
calculate_arrow_geometry (arrow_type, &x, &y, &width, &height);
-
+
if (DETAIL ("menuitem"))
x = original_x + original_width - width;
-
+
if (DETAIL ("spinbutton") && (arrow_type == GTK_ARROW_DOWN))
y += 1;
-
+
if (state == GTK_STATE_INSENSITIVE)
draw_arrow (window, style->light_gc[state], area, arrow_type, x + 1, y + 1, width, height);
gc = style->fg_gc[state];
-
+
draw_arrow (window, gc, area, arrow_type, x, y, width, height);
}
@@ -259,7 +259,7 @@ draw_flat_box (DRAW_ARGS)
sanitize_size (window, &width, &height);
- if (detail &&
+ if (detail &&
clearlooks_style->listviewitemstyle == 1 &&
state_type == GTK_STATE_SELECTED && (
!strncmp ("cell_even", detail, strlen ("cell_even")) ||
@@ -279,7 +279,7 @@ draw_flat_box (DRAW_ARGS)
gc = style->base_gc[GTK_STATE_ACTIVE];
upper_color = &style->base[GTK_STATE_ACTIVE];
}
-
+
if (GTK_IS_TREE_VIEW (widget) && 0)
{
GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
@@ -292,12 +292,12 @@ draw_flat_box (DRAW_ARGS)
return;
}
}
-
+
shade (upper_color, &lower_color, 0.8);
if (area)
gdk_gc_set_clip_rectangle (gc, area);
-
+
draw_hgradient (window, gc, style,
x, y, width, height, upper_color, &lower_color);
@@ -319,7 +319,7 @@ draw_shadow (DRAW_ARGS)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
CLRectangle r;
-
+
GdkGC *outer_gc = clearlooks_style->shade_gc[4];
GdkGC *gc1 = NULL;
GdkGC *gc2 = NULL;
@@ -358,12 +358,12 @@ draw_shadow (DRAW_ARGS)
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], area);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], area);
}
-
+
gdk_draw_line (window, clearlooks_style->shade_gc[3],
x, y, x + width, y);
gdk_draw_line (window, clearlooks_style->shade_gc[0],
x, y + 1, x + width, y + 1);
-
+
if (area)
{
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], NULL);
@@ -411,7 +411,7 @@ draw_shadow (DRAW_ARGS)
{
GdkGC *a = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 0 : 3];
GdkGC *b = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 3 : 0];
-
+
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
@@ -419,17 +419,17 @@ draw_shadow (DRAW_ARGS)
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x+1, y+1, width-1, height-1, &r);
cl_rectangle_reset_clip_rectangle (&r);
-
+
r.bordergc = b;
cl_rectangle_set_clip_rectangle (&r, area);
- cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r);
+ cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r);
cl_rectangle_reset_clip_rectangle (&r);
}
else if (shadow_type == GTK_SHADOW_ETCHED_IN)
{
GdkGC *a = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 3 : 0];
GdkGC *b = clearlooks_style->shade_gc[(shadow_type == GTK_SHADOW_ETCHED_IN) ? 0 : 3];
-
+
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
@@ -437,12 +437,12 @@ draw_shadow (DRAW_ARGS)
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x+1, y+1, width-1, height-1, &r);
cl_rectangle_reset_clip_rectangle (&r);
-
+
r.bordergc = b;
cl_rectangle_set_clip_rectangle (&r, area);
- cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r);
+ cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r);
cl_rectangle_reset_clip_rectangle (&r);
- }
+ }
else
parent_class->draw_shadow (style, window, state_type, shadow_type,
area, widget, detail,
@@ -464,7 +464,7 @@ draw_box_gap (DRAW_ARGS,
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
CLRectangle r;
-
+
GdkRegion *area_region = NULL,
*gap_region = NULL;
GdkRectangle light_rect;
@@ -473,10 +473,10 @@ draw_box_gap (DRAW_ARGS,
#if DEBUG
printf("draw_box_gap: %s %d %d %d %d\n", detail, x, y, width, height);
#endif
-
+
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
-
+
sanitize_size (window, &width, &height);
cl_rectangle_reset (&r, style);
@@ -493,7 +493,7 @@ draw_box_gap (DRAW_ARGS,
GdkRectangle tmp = { x, y, width, height };
area_region = gdk_region_rectangle (&tmp);
}
-
+
switch (gap_side)
{
case GTK_POS_TOP:
@@ -503,7 +503,7 @@ draw_box_gap (DRAW_ARGS,
GDK_RECTANGLE_SET (light_rect, x+gap_x+1, y, x+gap_x+1, y+1);
GDK_RECTANGLE_SET (dark_rect, x+gap_x+gap_width-2, y, x+gap_x+gap_width-2, y);
-
+
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_ROUND, CL_CORNER_ROUND);
@@ -513,7 +513,7 @@ draw_box_gap (DRAW_ARGS,
{
GdkRectangle rect = { x+gap_x+1, y+height-2, gap_width-2, 2 };
gap_region = gdk_region_rectangle (&rect);
-
+
GDK_RECTANGLE_SET (light_rect, x+gap_x+1, y+height-2, x+gap_x+1, y+height-1);
GDK_RECTANGLE_SET (dark_rect, x+gap_x+gap_width-2, y+height-2, x+gap_x+gap_width-2, y+height-1);
@@ -526,37 +526,37 @@ draw_box_gap (DRAW_ARGS,
{
GdkRectangle rect = { x, y+gap_x+1, 2, gap_width-2 };
gap_region = gdk_region_rectangle (&rect);
-
+
GDK_RECTANGLE_SET (light_rect, x, y+gap_x+1, x+1, y+gap_x+1);
GDK_RECTANGLE_SET (dark_rect, x, y+gap_x+gap_width-2, x, y+gap_x+gap_width-2);
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_ROUND,
CL_CORNER_NONE, CL_CORNER_ROUND);
break;
- }
+ }
case GTK_POS_RIGHT:
{
GdkRectangle rect = { x+width-2, y+gap_x+1, 2, gap_width-2 };
gap_region = gdk_region_rectangle (&rect);
-
+
GDK_RECTANGLE_SET (light_rect, x+width-2, y+gap_x+1, x+width-1, y+gap_x+1);
GDK_RECTANGLE_SET (dark_rect, x+width-2, y+gap_x+gap_width-2, x+width-1, y+gap_x+gap_width-2);
cl_rectangle_set_corners (&r, CL_CORNER_ROUND, CL_CORNER_NONE,
CL_CORNER_ROUND, CL_CORNER_NONE);
break;
- }
+ }
}
-
+
gdk_region_subtract (area_region, gap_region);
-
+
gdk_gc_set_clip_region (r.bordergc, area_region);
gdk_gc_set_clip_region (r.topleft, area_region);
gdk_gc_set_clip_region (r.bottomright, area_region);
-
+
gdk_region_destroy (area_region);
gdk_region_destroy (gap_region);
-
+
gdk_draw_rectangle (window, style->bg_gc[state_type], TRUE, x, y, width, height);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
@@ -566,12 +566,12 @@ draw_box_gap (DRAW_ARGS,
gdk_gc_set_clip_region (r.bordergc, NULL);
gdk_gc_set_clip_region (r.topleft, NULL);
gdk_gc_set_clip_region (r.bottomright, NULL);
-
+
/* it's a semi hack */
gdk_draw_line (window, style->light_gc[state_type],
light_rect.x, light_rect.y,
light_rect.width, light_rect.height);
-
+
gdk_draw_line (window, clearlooks_style->shade_gc[1],
dark_rect.x, dark_rect.y,
dark_rect.width, dark_rect.height);
@@ -592,9 +592,9 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side)
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
-
+
sanitize_size (window, &width, &height);
-
+
if (DETAIL ("tab"))
{
GdkRectangle new_area;
@@ -603,12 +603,12 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side)
cl_rectangle_set_button (&r, style, state_type, FALSE, FALSE,
CL_CORNER_ROUND, CL_CORNER_ROUND,
CL_CORNER_ROUND, CL_CORNER_ROUND);
-
+
if (state_type == GTK_STATE_ACTIVE)
shade (&style->bg[state_type], &tmp_color, 1.08);
else
shade (&style->bg[state_type], &tmp_color, 1.05);
-
+
if (area)
{
new_area = *area;
@@ -620,7 +620,7 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side)
new_area.width = width;
new_area.height = height;
}
-
+
switch (gap_side)
{
case GTK_POS_BOTTOM:
@@ -666,20 +666,20 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side)
&clearlooks_style->border[CL_BORDER_LOWER+my_state_type]);
break;
}
-
- r.topleft = style->light_gc[state_type];
+
+ r.topleft = style->light_gc[state_type];
r.bottomright = (state_type == GTK_STATE_NORMAL) ? clearlooks_style->shade_gc[1] : NULL;
cl_rectangle_set_clip_rectangle (&r, &new_area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
-
+
/* draw the selection stripe */
if (state_type != GTK_STATE_ACTIVE) {
cl_rectangle_set_gradient (&r.fill_gradient, NULL, NULL);
r.fillgc = clearlooks_style->spot2_gc;
-
+
switch (gap_side)
{
case GTK_POS_BOTTOM:
@@ -717,14 +717,14 @@ draw_extension (DRAW_ARGS, GtkPositionType gap_side)
CL_CORNER_ROUND, CL_CORNER_NONE);
cl_rectangle_set_gradient (&r.border_gradient, &clearlooks_style->spot3, &clearlooks_style->spot2);
r.gradient_type = CL_GRADIENT_HORIZONTAL;
-
+
cl_rectangle_set_clip_rectangle (&r, &new_area);
cl_draw_rectangle (window, widget, style, x, y, 3, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
break;
}
}
-
+
}
else
@@ -752,16 +752,16 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation)
int i;
int n_lines;
int offset;
-
+
#if DEBUG
printf("draw_handle: %s %d %d %d %d\n", detail, x, y, width, height);
#endif
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
-
+
sanitize_size (window, &width, &height);
-
+
if (state_type == GTK_STATE_PRELIGHT)
gtk_style_apply_default_background (style, window,
widget && !GTK_WIDGET_NO_WINDOW (widget),
@@ -786,10 +786,10 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation)
orientation == GTK_ORIENTATION_VERTICAL )
{
/* The line in the toolbar */
-
+
light_gc = style->light_gc[state_type];
dark_gc = clearlooks_style->shade_gc[3];
-
+
if (area)
{
gdk_gc_set_clip_rectangle (light_gc, area);
@@ -810,14 +810,14 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation)
gdk_draw_line (window, clearlooks_style->shade_gc[0], x, y, x + width, y);
gdk_draw_line (window, clearlooks_style->shade_gc[3], x, y + height - 1, x + width, y + height - 1);
-
+
if (area)
{
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], NULL);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], NULL);
}
}
-
+
light_gc = clearlooks_style->shade_gc[0];
dark_gc = clearlooks_style->shade_gc[4];
@@ -825,7 +825,7 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation)
rect.y = y + ythick;
rect.width = width - (xthick * 2);
rect.height = height - (ythick * 2);
-
+
if (area)
intersect = gdk_rectangle_intersect (area, &rect, &dest);
else
@@ -839,19 +839,19 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation)
gdk_gc_set_clip_rectangle (light_gc, &dest);
gdk_gc_set_clip_rectangle (dark_gc, &dest);
-
+
n_lines = (!strcmp (detail, "paned")) ? 21 : 11;
if (orientation == GTK_ORIENTATION_VERTICAL)
- {
+ {
h = width - 2 * xthick;
h = MAX (3, h - 6);
-
+
xx = x + (width - h) / 2;
offset = (height - 2*ythick - 2*n_lines)/2 + 1;
if (offset < 0)
offset = 0;
-
+
for (i = 0, yy = y + ythick + offset; yy <= (y + height - ythick - 1) && i < n_lines; yy += 2, i++)
{
gdk_draw_line (window, dark_gc, xx, yy, xx + h, yy);
@@ -862,12 +862,12 @@ draw_handle (DRAW_ARGS, GtkOrientation orientation)
{
h = height - 2 * ythick;
h = MAX (3, h - 6);
-
+
yy = y + (height - h) / 2;
offset = (width - 2*xthick - 2*n_lines)/2 + 1;
if (offset < 0)
offset = 0;
-
+
for (i = 0, xx = x + xthick + offset; i < n_lines; xx += 2, i++)
{
gdk_draw_line (window, dark_gc, xx, yy, xx, yy + h);
@@ -891,13 +891,13 @@ draw_box (DRAW_ARGS)
#ifdef DEBUG
printf("draw_box: %s %d %d %d %d\n", detail, x, y, width, height);
#endif
-
+
g_return_if_fail (style != NULL);
g_return_if_fail (window != NULL);
if (width == -1 || height == -1)
false_size = TRUE;
-
+
if ((width == -1) && (height == -1))
gdk_window_get_size (window, &width, &height);
else if (width == -1)
@@ -909,7 +909,7 @@ draw_box (DRAW_ARGS)
if (widget == NULL)
return;
-
+
/* listview headers */
if (widget && DETAIL ("button") && widget->parent &&
(GTK_IS_TREE_VIEW(widget->parent) ||
@@ -938,7 +938,7 @@ draw_box (DRAW_ARGS)
!strcmp (detail, "spinbutton_up") ||
!strcmp (detail, "spinbutton_down") ||
!strcmp (detail, "spinbutton")))
- {
+ {
cl_draw_spinbutton (style, window, state_type, shadow_type, area,
widget, detail, x, y, width, height);
}
@@ -955,7 +955,7 @@ draw_box (DRAW_ARGS)
r.fill_gradient.to = &clearlooks_style->shade[2];
r.bottomright = clearlooks_style->shade_gc[2];
}
-
+
cl_set_corner_sharpness (detail, widget, &r);
if (!strcmp (detail, "spinbutton_up"))
@@ -971,24 +971,24 @@ draw_box (DRAW_ARGS)
gtk_style_apply_default_background (style, window, FALSE, state_type,
area, x, y, width, height);
}
-
- cl_rectangle_set_clip_rectangle (&r, area);
+
+ cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x+1, y+1, width-2, height-2, &r);
cl_draw_shadow (window, widget, style, x+1, y+1, width-2, height-2, &r);
- cl_rectangle_reset_clip_rectangle (&r);
+ cl_rectangle_reset_clip_rectangle (&r);
}
else if (DETAIL ("trough") && GTK_IS_PROGRESS_BAR (widget))
{
GdkPoint points[4] = { {x,y}, {x+width-1,y}, {x,y+height-1}, {x+width-1,y+height-1} };
-
+
gdk_draw_points (window, style->bg_gc[state_type], points, 4);
-
+
r.bordergc = clearlooks_style->shade_gc[5];
r.fillgc = clearlooks_style->shade_gc[2];
-
+
cl_rectangle_set_corners (&r, CL_CORNER_NARROW, CL_CORNER_NARROW,
CL_CORNER_NARROW, CL_CORNER_NARROW);
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
@@ -1001,11 +1001,11 @@ draw_box (DRAW_ARGS)
*shadow = clearlooks_style->shade_gc[4];
GdkColor upper_color = *clearlooks_get_spot_color (CLEARLOOKS_RC_STYLE (style->rc_style)),
lower_color;
-
+
GtkAdjustment *adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
-
+
GtkOrientation orientation = GTK_RANGE (widget)->orientation;
-
+
gint fill_size = (orientation ? height : width) *
(1 / ((adjustment->upper - adjustment->lower) /
(adjustment->value - adjustment->lower)));
@@ -1020,60 +1020,60 @@ draw_box (DRAW_ARGS)
x += (width - SCALE_SIZE) / 2;
width = SCALE_SIZE;
}
-
+
if (state_type == GTK_STATE_INSENSITIVE)
{
outer = clearlooks_style->shade_gc[4];
inner = clearlooks_style->shade_gc[2];
shadow = clearlooks_style->shade_gc[3];
}
-
+
cl_rectangle_init (&r, inner, outer, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE );
-
+
r.topleft = shadow;
-
- cl_rectangle_set_clip_rectangle (&r, area);
+
+ cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
- cl_rectangle_reset_clip_rectangle (&r);
+ cl_rectangle_reset_clip_rectangle (&r);
/* DRAW FILL */
shade (&upper_color, &lower_color, 1.3);
-
+
r.bordergc = clearlooks_style->spot3_gc;
r.fillgc = style->bg_gc[state_type];
-
+
r.gradient_type = (orientation == GTK_ORIENTATION_HORIZONTAL ) ? CL_GRADIENT_VERTICAL
: CL_GRADIENT_HORIZONTAL;
-
+
cl_rectangle_set_gradient (&r.fill_gradient, &upper_color, &lower_color);
-
- cl_rectangle_set_clip_rectangle (&r, area);
+
+ cl_rectangle_set_clip_rectangle (&r, area);
if (orientation == GTK_ORIENTATION_HORIZONTAL && fill_size > 1)
{
if (gtk_range_get_inverted(GTK_RANGE(widget)) != (get_direction(widget) == GTK_TEXT_DIR_RTL))
cl_draw_rectangle (window, widget, style, x+width-fill_size, y, fill_size, height, &r);
else
- cl_draw_rectangle (window, widget, style, x, y, fill_size, height, &r);
+ cl_draw_rectangle (window, widget, style, x, y, fill_size, height, &r);
}
else if (fill_size > 1)
{
if (gtk_range_get_inverted (GTK_RANGE (widget)))
cl_draw_rectangle (window, widget, style, x, y+height-fill_size, width, fill_size, &r);
else
- cl_draw_rectangle (window, widget, style, x, y, width, fill_size, &r);
+ cl_draw_rectangle (window, widget, style, x, y, width, fill_size, &r);
}
- cl_rectangle_reset_clip_rectangle (&r);
+ cl_rectangle_reset_clip_rectangle (&r);
}
else if (DETAIL ("trough"))
{
GdkGC *inner = clearlooks_style->shade_gc[3],
- *outer = clearlooks_style->shade_gc[5];
-
+ *outer = clearlooks_style->shade_gc[5];
+
cl_rectangle_init (&r, inner, outer, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE );
-
+
if (GTK_RANGE (widget)->orientation == GTK_ORIENTATION_VERTICAL)
{
y+=1;
@@ -1084,7 +1084,7 @@ draw_box (DRAW_ARGS)
x+=1;
width-=2;
}
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
@@ -1114,18 +1114,18 @@ draw_box (DRAW_ARGS)
}
cl_rectangle_set_button (&r, style, state_type, FALSE, FALSE, 0,0,0,0);
-
+
cl_rectangle_set_gradient (&r.fill_gradient, NULL, NULL);
cl_rectangle_set_gradient (&r.fill_gradient, &clearlooks_style->inset_light[state_type],
&clearlooks_style->inset_dark[state_type]);
-
-
+
+
r.gradient_type = horizontal ? CL_GRADIENT_VERTICAL
: CL_GRADIENT_HORIZONTAL;
-
+
r.bottomright = clearlooks_style->shade_gc[1];
r.border_gradient.to = r.border_gradient.from;
-
+
if (button_type == CL_SCROLLBUTTON_OTHER)
{
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
@@ -1149,11 +1149,11 @@ draw_box (DRAW_ARGS)
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_ROUND, CL_CORNER_ROUND);
}
-
- cl_rectangle_set_clip_rectangle (&r, area);
+
+ cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
- cl_rectangle_reset_clip_rectangle (&r);
+ cl_rectangle_reset_clip_rectangle (&r);
}
else if (DETAIL ("slider"))
@@ -1161,7 +1161,7 @@ draw_box (DRAW_ARGS)
if (DETAIL("slider") && widget && GTK_IS_RANGE (widget))
{
GtkAdjustment *adj = GTK_RANGE (widget)->adjustment;
-
+
if (adj->value <= adj->lower &&
(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b))
{
@@ -1185,11 +1185,11 @@ draw_box (DRAW_ARGS)
width+=1;
}
}
-
+
cl_rectangle_set_button (&r, style, state_type, FALSE, GTK_WIDGET_HAS_FOCUS (widget),
CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
-
+
r.gradient_type = GTK_IS_HSCROLLBAR (widget) ? CL_GRADIENT_VERTICAL
: CL_GRADIENT_HORIZONTAL;
@@ -1198,11 +1198,11 @@ draw_box (DRAW_ARGS)
r.bottomright = clearlooks_style->shade_gc[1];
r.border_gradient.to = r.border_gradient.from;
-
- cl_rectangle_set_clip_rectangle (&r, area);
+
+ cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
- cl_rectangle_reset_clip_rectangle (&r);
+ cl_rectangle_reset_clip_rectangle (&r);
}
else if (detail && !strcmp (detail, "optionmenu")) /* supporting deprecated */
{
@@ -1213,7 +1213,7 @@ draw_box (DRAW_ARGS)
if (clearlooks_style->menuitemstyle == 0)
{
cl_draw_menuitem_flat (window, widget, style, area, state_type,
- x, y, width, height, &r);
+ x, y, width, height, &r);
}
else if (clearlooks_style->menuitemstyle == 1)
{
@@ -1230,52 +1230,52 @@ draw_box (DRAW_ARGS)
{
GdkGC *dark = clearlooks_style->shade_gc[2];
GdkColor upper_color, lower_color;
-
+
/* don't draw sunken menubar on gnome panel
IT'S A HACK! HORRIBLE HACK! HIDEOUS HACK!
BUT IT WORKS FOR ME(tm)! */
if (widget->parent &&
strcmp(G_OBJECT_TYPE_NAME (widget->parent), "PanelWidget") == 0)
return;
-
+
shade(&style->bg[state_type], &upper_color, 1.0);
shade(&style->bg[state_type], &lower_color, 0.95);
-
+
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
-
+
r.fillgc = style->bg_gc[state_type];
r.bordergc = clearlooks_style->shade_gc[2];
r.gradient_type = CL_GRADIENT_VERTICAL;
-
+
cl_rectangle_set_gradient (&r.border_gradient, &clearlooks_style->shade[2],
&clearlooks_style->shade[3]);
cl_rectangle_set_gradient (&r.fill_gradient, &upper_color, &lower_color);
-
+
/* make vertical and top borders invisible for style 2 */
if (clearlooks_style->menubarstyle == 2) {
x--; width+=2;
y--; height+=1;
}
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
}
else if (DETAIL ("menu") && widget->parent &&
GDK_IS_WINDOW (widget->parent->window))
- {
+ {
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
-
+
r.bordergc = clearlooks_style->border_gc[CL_BORDER_UPPER];
r.topleft = style->light_gc[state_type];
r.bottomright = clearlooks_style->shade_gc[1];
-
+
cl_rectangle_set_clip_rectangle (&r, area);
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
- cl_rectangle_reset_clip_rectangle (&r);
+ cl_rectangle_reset_clip_rectangle (&r);
return;
}
@@ -1285,29 +1285,29 @@ draw_box (DRAW_ARGS)
lower_color,
prev_foreground;
gboolean activity_mode = GTK_PROGRESS (widget)->activity_mode;
-
+
#ifdef HAVE_ANIMATION
if (!activity_mode && gtk_progress_bar_get_fraction (widget) != 1.0 &&
!cl_progressbar_known((gconstpointer)widget))
{
cl_progressbar_add ((gpointer)widget);
}
-#endif
+#endif
cl_progressbar_fill (window, widget, style, style->black_gc,
x, y, width, height,
#ifdef HAVE_ANIMATION
activity_mode ? 0 : pboffset,
#else
- 0,
+ 0,
#endif
area);
-
+
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
-
+
r.bordergc = clearlooks_style->spot3_gc;
r.topleft = clearlooks_style->spot2_gc;
-
+
prev_foreground = cl_gc_set_fg_color_shade (clearlooks_style->spot2_gc,
style->colormap,
&clearlooks_style->spot2,
@@ -1317,7 +1317,7 @@ draw_box (DRAW_ARGS)
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
cl_rectangle_reset_clip_rectangle (&r);
-
+
gdk_gc_set_foreground (clearlooks_style->spot2_gc, &prev_foreground);
}
@@ -1328,21 +1328,21 @@ draw_box (DRAW_ARGS)
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], area);
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[3], area);
}
-
+
gtk_style_apply_default_background (style, window,
widget && !GTK_WIDGET_NO_WINDOW (widget),
state_type, area, x, y, width, height);
-
+
/* we only want the borders on horizontal toolbars */
if ( DETAIL ("menubar") || height < 2*width ) {
if (!DETAIL ("menubar"))
gdk_draw_line (window, clearlooks_style->shade_gc[0],
x, y, x + width, y); /* top */
-
+
gdk_draw_line (window, clearlooks_style->shade_gc[3],
x, y + height - 1, x + width, y + height - 1); /* bottom */
}
-
+
if (area)
{
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[0], NULL);
@@ -1368,10 +1368,10 @@ ensure_check_pixmaps (GtkStyle *style,
ClearlooksRcStyle *clearlooks_rc = CLEARLOOKS_RC_STYLE (style->rc_style);
GdkPixbuf *check, *base, *inconsistent, *composite;
GdkColor *spot_color = clearlooks_get_spot_color (clearlooks_rc);
-
+
if (clearlooks_style->check_pixmap_nonactive[state] != NULL)
return;
-
+
if (state == GTK_STATE_ACTIVE || state == GTK_STATE_SELECTED) {
check = generate_bit (check_alpha, &style->text[GTK_STATE_NORMAL], 1.0);
inconsistent = generate_bit (check_inconsistent_alpha, &style->text[GTK_STATE_NORMAL], 1.0);
@@ -1379,24 +1379,24 @@ ensure_check_pixmaps (GtkStyle *style,
check = generate_bit (check_alpha, &style->text[state], 1.0);
inconsistent = generate_bit (check_inconsistent_alpha, &style->text[state], 1.0);
}
-
+
if (state == GTK_STATE_ACTIVE && !treeview)
base = generate_bit (check_base_alpha, &style->bg[state], 1.0);
else
base = generate_bit (check_base_alpha, &style->base[GTK_STATE_NORMAL], 1.0);
-
+
if (treeview)
composite = generate_bit (NULL, &clearlooks_style->shade[6], 1.0);
else
composite = generate_bit (NULL, &clearlooks_style->shade[5], 1.0);
-
+
gdk_pixbuf_composite (base, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
clearlooks_style->check_pixmap_nonactive[state] =
pixbuf_to_pixmap (style, composite, screen);
-
+
gdk_pixbuf_composite (check, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
@@ -1457,7 +1457,7 @@ draw_check (DRAW_ARGS)
y += (height - CHECK_SIZE)/2;
gdk_draw_drawable (window, gc, pixmap, 0, 0, x, y, CHECK_SIZE, CHECK_SIZE);
-
+
if (area)
gdk_gc_set_clip_rectangle (gc, NULL);
}
@@ -1486,7 +1486,7 @@ draw_slider (DRAW_ARGS, GtkOrientation orientation)
if ((orientation == GTK_ORIENTATION_VERTICAL && height < 20) ||
(orientation == GTK_ORIENTATION_HORIZONTAL && width < 20))
return;
-
+
if (detail && strcmp ("slider", detail) == 0)
{
if (area)
@@ -1571,10 +1571,10 @@ ensure_radio_pixmaps (GtkStyle *style,
GdkPixbuf *dot, *circle, *outline, *inconsistent, *composite;
GdkColor *spot_color = clearlooks_get_spot_color (clearlooks_rc);
GdkColor *composite_color;
-
+
if (clearlooks_style->radio_pixmap_nonactive[state] != NULL)
return;
-
+
if (state == GTK_STATE_ACTIVE || state == GTK_STATE_SELECTED) {
dot = colorize_bit (dot_intensity, dot_alpha, &style->text[GTK_STATE_NORMAL]);
inconsistent = generate_bit (inconsistent_alpha, &style->text[GTK_STATE_NORMAL], 1.0);
@@ -1582,9 +1582,9 @@ ensure_radio_pixmaps (GtkStyle *style,
dot = colorize_bit (dot_intensity, dot_alpha, &style->text[state]);
inconsistent = generate_bit (inconsistent_alpha, &style->text[state], 1.0);
}
-
+
outline = generate_bit (outline_alpha, &clearlooks_style->shade[5], 1.0);
-
+
if (clearlooks_style->radio_pixmap_mask == NULL)
{
gdk_pixbuf_render_pixmap_and_mask (outline,
@@ -1592,7 +1592,7 @@ ensure_radio_pixmaps (GtkStyle *style,
&clearlooks_style->radio_pixmap_mask,
1);
}
-
+
if (state == GTK_STATE_ACTIVE)
{
composite_color = &style->bg[GTK_STATE_PRELIGHT];
@@ -1603,31 +1603,31 @@ ensure_radio_pixmaps (GtkStyle *style,
composite_color = &style->bg[state];
circle = generate_bit (circle_alpha, &style->base[GTK_STATE_NORMAL], 1.0);
}
-
+
composite = generate_bit (NULL, composite_color, 1.0);
-
+
gdk_pixbuf_composite (outline, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
-
+
gdk_pixbuf_composite (circle, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
-
+
clearlooks_style->radio_pixmap_nonactive[state] =
pixbuf_to_pixmap (style, composite, screen);
-
+
gdk_pixbuf_composite (dot, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
-
+
clearlooks_style->radio_pixmap_active[state] =
pixbuf_to_pixmap (style, composite, screen);
-
+
g_object_unref (composite);
-
+
composite = generate_bit (NULL, composite_color,1.0);
-
+
gdk_pixbuf_composite (outline, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
@@ -1637,10 +1637,10 @@ ensure_radio_pixmaps (GtkStyle *style,
gdk_pixbuf_composite (inconsistent, composite,
0, 0, RADIO_SIZE, RADIO_SIZE, 0, 0,
1.0, 1.0, GDK_INTERP_NEAREST, 255);
-
+
clearlooks_style->radio_pixmap_inconsistent[state] =
pixbuf_to_pixmap (style, composite, screen);
-
+
g_object_unref (composite);
g_object_unref (circle);
g_object_unref (dot);
@@ -1654,42 +1654,42 @@ draw_option (DRAW_ARGS)
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
GdkGC *gc = style->base_gc[state_type];
GdkPixmap *pixmap;
-
+
if (DETAIL ("option")) /* Menu item */
{
parent_class->draw_option (style, window, state_type, shadow_type,
area, widget, detail, x, y, width, height);
return;
}
-
+
ensure_radio_pixmaps (style, state_type, gtk_widget_get_screen (widget));
-
+
if (area)
gdk_gc_set_clip_rectangle (gc, area);
-
+
if (shadow_type == GTK_SHADOW_IN)
pixmap = clearlooks_style->radio_pixmap_active[state_type];
else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */
pixmap = clearlooks_style->radio_pixmap_inconsistent[state_type];
else
pixmap = clearlooks_style->radio_pixmap_nonactive[state_type];
-
+
x += (width - RADIO_SIZE)/2;
y += (height - RADIO_SIZE)/2;
-
+
#ifndef GTKOSX
gdk_gc_set_clip_mask (gc, clearlooks_style->radio_pixmap_mask);
gdk_gc_set_clip_origin (gc, x, y);
#endif
-
+
gdk_draw_drawable (window, gc, pixmap, 0, 0, x, y,
RADIO_SIZE, RADIO_SIZE);
-
+
#ifndef GTKOSX
gdk_gc_set_clip_origin (gc, 0, 0);
gdk_gc_set_clip_mask (gc, NULL);
#endif
-
+
if (area)
gdk_gc_set_clip_rectangle (gc, NULL);
}
@@ -1714,17 +1714,17 @@ draw_shadow_gap (DRAW_ARGS,
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
-
+
sanitize_size (window, &width, &height);
cl_rectangle_reset (&r, style);
cl_rectangle_set_corners (&r, CL_CORNER_NONE, CL_CORNER_NONE,
CL_CORNER_NONE, CL_CORNER_NONE);
-
+
if (area)
{
area_region = gdk_region_rectangle (area);
-
+
switch (gap_side)
{
case GTK_POS_TOP:
@@ -1744,18 +1744,18 @@ draw_shadow_gap (DRAW_ARGS,
GdkRectangle rect = { x, y+gap_x, 2, gap_width };
gap_region = gdk_region_rectangle (&rect);
break;
- }
+ }
case GTK_POS_RIGHT:
{
GdkRectangle rect = { x+width-2, y+gap_x, 2, gap_width };
gap_region = gdk_region_rectangle (&rect);
break;
- }
+ }
}
-
+
gdk_region_subtract (area_region, gap_region);
}
-
+
if (shadow_type == GTK_SHADOW_ETCHED_IN ||
shadow_type == GTK_SHADOW_ETCHED_OUT)
{
@@ -1772,9 +1772,9 @@ draw_shadow_gap (DRAW_ARGS,
a = clearlooks_style->shade_gc[3];
b = style->light_gc[state_type];
}
-
- gdk_gc_set_clip_region (a, area_region);
- gdk_gc_set_clip_region (b, area_region);
+
+ gdk_gc_set_clip_region (a, area_region);
+ gdk_gc_set_clip_region (b, area_region);
r.bordergc = a;
cl_draw_rectangle (window, widget, style, x+1, y+1, width-1, height-1, &r);
@@ -1782,21 +1782,21 @@ draw_shadow_gap (DRAW_ARGS,
r.bordergc = b;
cl_draw_rectangle (window, widget, style, x, y, width-1, height-1, &r);
- gdk_gc_set_clip_region (a, NULL);
- gdk_gc_set_clip_region (b, NULL);
+ gdk_gc_set_clip_region (a, NULL);
+ gdk_gc_set_clip_region (b, NULL);
}
else if (shadow_type == GTK_SHADOW_IN || shadow_type == GTK_SHADOW_OUT)
{
r.topleft = (shadow_type == GTK_SHADOW_OUT) ? style->light_gc[state_type] : clearlooks_style->shade_gc[1];
r.bottomright = (shadow_type == GTK_SHADOW_OUT) ? clearlooks_style->shade_gc[1] : style->light_gc[state_type];
r.bordergc = clearlooks_style->shade_gc[5];
-
- gdk_gc_set_clip_region (r.bordergc, area_region);
- gdk_gc_set_clip_region (r.topleft, area_region);
- gdk_gc_set_clip_region (r.bottomright, area_region);
-
+
+ gdk_gc_set_clip_region (r.bordergc, area_region);
+ gdk_gc_set_clip_region (r.topleft, area_region);
+ gdk_gc_set_clip_region (r.bottomright, area_region);
+
cl_draw_rectangle (window, widget, style, x, y, width, height, &r);
-
+
cl_draw_shadow (window, widget, style, x, y, width, height, &r);
gdk_gc_set_clip_region (r.bordergc, NULL);
@@ -1828,25 +1828,25 @@ draw_hline (GtkStyle *style,
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
-
+
if (area)
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], area);
-
+
if (detail && !strcmp (detail, "label"))
{
if (state_type == GTK_STATE_INSENSITIVE)
gdk_draw_line (window, style->light_gc[state_type], x1 + 1, y + 1, x2 + 1, y + 1);
-
+
gdk_draw_line (window, style->fg_gc[state_type], x1, y, x2, y);
}
else
{
gdk_draw_line (window, clearlooks_style->shade_gc[2], x1, y, x2, y);
-
+
/* if (DETAIL ("menuitem")) */
gdk_draw_line (window, clearlooks_style->shade_gc[0], x1, y+1, x2, y+1);
}
-
+
if (area)
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], NULL);
}
@@ -1873,16 +1873,16 @@ draw_vline (GtkStyle *style,
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (window != NULL);
-
+
thickness_light = style->xthickness / 2;
thickness_dark = style->xthickness - thickness_light;
-
+
if (area)
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], area);
-
+
gdk_draw_line (window, clearlooks_style->shade_gc[2], x, y1, x, y2 - 1);
gdk_draw_line (window, clearlooks_style->shade_gc[0], x+1, y1, x+1, y2 - 1);
-
+
if (area)
gdk_gc_set_clip_rectangle (clearlooks_style->shade_gc[2], NULL);
}
@@ -1911,38 +1911,38 @@ draw_focus (GtkStyle *style,
#if DEBUG
printf("draw_focus: %s %d %d %d %d\n", detail, x, y, width, height);
#endif
-
+
gc = clearlooks_style->shade_gc[6];
-
+
if (widget)
{
gtk_widget_style_get (widget,
"focus-line-width", &line_width,
"focus-line-pattern", (gchar *)&dash_list,
NULL);
-
+
free_dash_list = TRUE;
}
-
+
sanitize_size (window, &width, &height);
-
+
if (area)
gdk_gc_set_clip_rectangle (gc, area);
-
+
gdk_gc_set_line_attributes (gc, line_width,
dash_list[0] ? GDK_LINE_ON_OFF_DASH : GDK_LINE_SOLID,
GDK_CAP_BUTT, GDK_JOIN_MITER);
-
-
+
+
if (detail && !strcmp (detail, "add-mode"))
{
if (free_dash_list)
g_free (dash_list);
-
+
dash_list = "\4\4";
free_dash_list = FALSE;
}
-
+
points[0].x = x + line_width / 2;
points[0].y = y + line_width / 2;
points[1].x = x + width - line_width + line_width / 2;
@@ -1952,7 +1952,7 @@ draw_focus (GtkStyle *style,
points[3].x = x + line_width / 2;
points[3].y = y + height - line_width + line_width / 2;
points[4] = points[0];
-
+
if (!dash_list[0])
{
gdk_draw_lines (window, gc, points, 5);
@@ -1960,41 +1960,41 @@ draw_focus (GtkStyle *style,
else
{
dash_len = strlen (dash_list);
-
+
if (dash_list[0])
gdk_gc_set_dashes (gc, 0, dash_list, dash_len);
-
+
gdk_draw_lines (window, gc, points, 3);
-
+
points[2].x += 1;
-
+
if (dash_list[0])
{
gint dash_pixels = 0;
gint i;
-
+
/* Adjust the dash offset for the bottom and left so we
* match up at the upper left.
*/
for (i = 0; i < dash_len; i++)
dash_pixels += dash_list[i];
-
+
if (dash_len % 2 == 1)
dash_pixels *= 2;
-
+
gdk_gc_set_dashes (gc,
dash_pixels - (width + height - 2 * line_width) % dash_pixels,
dash_list, dash_len);
}
-
+
gdk_draw_lines (window, gc, points + 2, 3);
}
-
+
gdk_gc_set_line_attributes (gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
-
+
if (area)
gdk_gc_set_clip_rectangle (gc, NULL);
-
+
if (free_dash_list)
g_free (dash_list);
}
@@ -2009,14 +2009,14 @@ draw_layout(GtkStyle * style,
const gchar * detail, gint x, gint y, PangoLayout * layout)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-
+
g_return_if_fail(GTK_IS_STYLE (style));
g_return_if_fail(window != NULL);
parent_class->draw_layout(style, window, state_type, use_text,
area, widget, detail, x, y, layout);
-
+
}
/**************************************************************************/
@@ -2205,7 +2205,7 @@ draw_resize_grip (GtkStyle *style,
xi -= 3;
yi -= 3;
-
+
}
}
break;
@@ -2260,7 +2260,7 @@ draw_resize_grip (GtkStyle *style,
xi -= 3;
yi += 3;
-
+
}
}
break;
@@ -2316,26 +2316,26 @@ clearlooks_style_init_from_rc (GtkStyle * style,
double shades[] = {1.065, 0.93, 0.896, 0.85, 0.768, 0.665, 0.4, 0.205};
int i;
double contrast;
-
+
parent_class->init_from_rc (style, rc_style);
-
+
contrast = CLEARLOOKS_RC_STYLE (rc_style)->contrast;
-
+
clearlooks_style->sunkenmenubar = CLEARLOOKS_RC_STYLE (rc_style)->sunkenmenubar;
clearlooks_style->progressbarstyle = CLEARLOOKS_RC_STYLE (rc_style)->progressbarstyle;
clearlooks_style->menubarstyle = CLEARLOOKS_RC_STYLE (rc_style)->menubarstyle;
clearlooks_style->menuitemstyle = CLEARLOOKS_RC_STYLE (rc_style)->menuitemstyle;
clearlooks_style->listviewitemstyle = CLEARLOOKS_RC_STYLE (rc_style)->listviewitemstyle;
-
+
/* Lighter to darker */
for (i = 0; i < 8; i++)
{
shade (&style->bg[GTK_STATE_NORMAL], &clearlooks_style->shade[i],
(shades[i]-0.7) * contrast + 0.7);
}
-
+
spot_color = clearlooks_get_spot_color (CLEARLOOKS_RC_STYLE (rc_style));
-
+
clearlooks_style->spot_color = *spot_color;
shade (&clearlooks_style->spot_color, &clearlooks_style->spot1, 1.42);
shade (&clearlooks_style->spot_color, &clearlooks_style->spot2, 1.05);
@@ -2352,11 +2352,11 @@ realize_color (GtkStyle * style,
GdkColor * color)
{
GdkGCValues gc_values;
-
+
gdk_colormap_alloc_color (style->colormap, color, FALSE, TRUE);
-
+
gc_values.foreground = *color;
-
+
return gtk_gc_get (style->depth, style->colormap, &gc_values, GDK_GC_FOREGROUND);
}
@@ -2365,15 +2365,15 @@ clearlooks_style_realize (GtkStyle * style)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
int i;
-
+
parent_class->realize (style);
-
+
for (i = 0; i < 8; i++)
clearlooks_style->shade_gc[i] = realize_color (style, &clearlooks_style->shade[i]);
for (i=0; i < CL_BORDER_COUNT; i++)
clearlooks_style->border_gc[i] = realize_color (style, &clearlooks_style->border[i]);
-
+
clearlooks_style->spot1_gc = realize_color (style, &clearlooks_style->spot1);
clearlooks_style->spot2_gc = realize_color (style, &clearlooks_style->spot2);
clearlooks_style->spot3_gc = realize_color (style, &clearlooks_style->spot3);
@@ -2390,10 +2390,10 @@ clearlooks_style_realize (GtkStyle * style)
shade (&style->bg[i], &clearlooks_style->listview_bg[i], 1.015);
gdk_rgb_find_color (style->colormap, &clearlooks_style->listview_bg[i]);
- /* CREATE GRADIENT FOR BUTTONS */
+ /* CREATE GRADIENT FOR BUTTONS */
shade (&style->bg[i], &clearlooks_style->button_g1[i], 1.055);
gdk_rgb_find_color (style->colormap, &clearlooks_style->button_g1[i]);
-
+
shade (&style->bg[i], &clearlooks_style->button_g2[i], 1.005);
gdk_rgb_find_color (style->colormap, &clearlooks_style->button_g2[i]);
@@ -2411,7 +2411,7 @@ clearlooks_style_unrealize (GtkStyle * style)
{
ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
int i;
-
+
/* We don't free the colors, because we don't know if
* gtk_gc_release() actually freed the GC. FIXME - need
* a way of ref'ing colors explicitely so GtkGC can
@@ -2419,11 +2419,11 @@ clearlooks_style_unrealize (GtkStyle * style)
*/
for (i=0; i < 8; i++)
gtk_gc_release (clearlooks_style->shade_gc[i]);
-
+
gtk_gc_release (clearlooks_style->spot1_gc);
gtk_gc_release (clearlooks_style->spot2_gc);
gtk_gc_release (clearlooks_style->spot3_gc);
-
+
for (i = 0; i < 5; i++)
{
if (clearlooks_style->radio_pixmap_nonactive[i] != NULL)
@@ -2435,7 +2435,7 @@ clearlooks_style_unrealize (GtkStyle * style)
g_object_unref (clearlooks_style->radio_pixmap_inconsistent[i]);
clearlooks_style->radio_pixmap_inconsistent[i] = NULL;
}
-
+
if (clearlooks_style->check_pixmap_nonactive[i] != NULL)
{
g_object_unref (clearlooks_style->check_pixmap_nonactive[i]);
@@ -2446,21 +2446,21 @@ clearlooks_style_unrealize (GtkStyle * style)
clearlooks_style->check_pixmap_inconsistent[i] = NULL;
}
}
-
+
if (clearlooks_style->radio_pixmap_mask != NULL)
g_object_unref (clearlooks_style->radio_pixmap_mask);
-
+
clearlooks_style->radio_pixmap_mask = NULL;
while (progressbars = g_list_first (progressbars))
cl_progressbar_remove (progressbars->data);
-
+
if (timer_id != 0)
{
g_source_remove(timer_id);
- timer_id = 0;
+ timer_id = 0;
}
-
+
parent_class->unrealize (style);
}
@@ -2529,16 +2529,16 @@ render_icon (GtkStyle *style,
GdkPixbuf *base_pixbuf;
GdkScreen *screen;
GtkSettings *settings;
-
+
/* Oddly, style can be NULL in this function, because
* GtkIconSet can be used without a style and if so
* it uses this function.
*/
-
+
base_pixbuf = gtk_icon_source_get_pixbuf (source);
-
+
g_return_val_if_fail (base_pixbuf != NULL, NULL);
-
+
if (widget && gtk_widget_has_screen (widget)) {
screen = gtk_widget_get_screen (widget);
settings = gtk_settings_get_for_screen (screen);
@@ -2550,7 +2550,7 @@ render_icon (GtkStyle *style,
GTK_NOTE (MULTIHEAD,
g_warning ("Using the default screen for gtk_default_render_icon()"));
}
-
+
if (size != (GtkIconSize) -1 && !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) {
g_warning (G_STRLOC ": invalid icon size '%d'", size);
@@ -2564,7 +2564,7 @@ render_icon (GtkStyle *style,
scaled = scale_or_ref (base_pixbuf, width, height);
else
scaled = g_object_ref (base_pixbuf);
-
+
/* If the state was wildcarded, then generate a state. */
if (gtk_icon_source_get_state_wildcarded (source)) {
if (state == GTK_STATE_INSENSITIVE) {
@@ -2581,14 +2581,14 @@ render_icon (GtkStyle *style,
#endif
gdk_pixbuf_saturate_and_pixelate (stated, stated,
0.1, FALSE);
-
+
g_object_unref (scaled);
} else if (state == GTK_STATE_PRELIGHT) {
stated = gdk_pixbuf_copy (scaled);
-
+
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
1.2, FALSE);
-
+
g_object_unref (scaled);
} else {
stated = scaled;
@@ -2609,7 +2609,7 @@ static void
clearlooks_style_class_init (ClearlooksStyleClass * klass)
{
GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
-
+
parent_class = g_type_class_peek_parent (klass);
style_class->realize = clearlooks_style_realize;
@@ -2630,7 +2630,7 @@ clearlooks_style_class_init (ClearlooksStyleClass * klass)
style_class->draw_box_gap = draw_box_gap;
style_class->draw_extension = draw_extension;
style_class->draw_option = draw_option;
- style_class->draw_layout = draw_layout;
+ style_class->draw_layout = draw_layout;
style_class->render_icon = render_icon;
style_class->draw_flat_box = draw_flat_box;
}
diff --git a/libs/clearlooks-older/clearlooks_style.h b/libs/clearlooks-older/clearlooks_style.h
index 1e07877bf7..d56876d533 100644
--- a/libs/clearlooks-older/clearlooks_style.h
+++ b/libs/clearlooks-older/clearlooks_style.h
@@ -55,43 +55,43 @@ typedef enum
struct _ClearlooksStyle
{
GtkStyle parent_instance;
-
+
GdkColor shade[9];
-
+
GdkColor spot_color;
GdkColor spot1;
GdkColor spot2;
GdkColor spot3;
-
+
GdkColor border[CL_BORDER_COUNT];
-
+
/* from light to dark */
GdkGC *shade_gc[9];
GdkGC *border_gc[CL_BORDER_COUNT];
-
+
GdkGC *spot1_gc;
GdkGC *spot2_gc;
GdkGC *spot3_gc;
-
+
GdkColor inset_light[5];
GdkColor inset_dark[5];
-
+
GdkColor button_g1[5];
GdkColor button_g2[5];
GdkColor button_g3[5];
GdkColor button_g4[5];
-
+
GdkColor listview_bg[5];
GdkPixmap *radio_pixmap_nonactive[5];
GdkPixmap *radio_pixmap_active[5];
GdkPixmap *radio_pixmap_inconsistent[5];
GdkBitmap *radio_pixmap_mask; /* All masks are the same */
-
+
GdkPixmap *check_pixmap_nonactive[5];
GdkPixmap *check_pixmap_active[5];
GdkPixmap *check_pixmap_inconsistent[5];
-
+
gboolean sunkenmenubar:1;
guint8 progressbarstyle;
diff --git a/libs/clearlooks-older/support.c b/libs/clearlooks-older/support.c
index 0d288123f2..d34a41b637 100644
--- a/libs/clearlooks-older/support.c
+++ b/libs/clearlooks-older/support.c
@@ -6,12 +6,12 @@ GtkTextDirection
get_direction (GtkWidget *widget)
{
GtkTextDirection dir;
-
+
if (widget)
dir = gtk_widget_get_direction (widget);
else
dir = GTK_TEXT_DIR_LTR;
-
+
return dir;
}
@@ -23,22 +23,22 @@ generate_bit (unsigned char alpha[], GdkColor *color, double mult)
unsigned char *pixels;
int w, h, rs;
int x, y;
-
+
r = (color->red >> 8) * mult;
r = MIN(r, 255);
g = (color->green >> 8) * mult;
g = MIN(g, 255);
b = (color->blue >> 8) * mult;
b = MIN(b, 255);
-
+
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, RADIO_SIZE, RADIO_SIZE);
-
+
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
rs = gdk_pixbuf_get_rowstride (pixbuf);
pixels = gdk_pixbuf_get_pixels (pixbuf);
-
-
+
+
for (y=0; y < h; y++)
{
for (x=0; x < w; x++)
@@ -52,7 +52,7 @@ generate_bit (unsigned char alpha[], GdkColor *color, double mult)
pixels[y*rs + x*4 + 3] = 255;
}
}
-
+
return pixbuf;
}
@@ -71,29 +71,29 @@ colorize_bit (unsigned char *bit,
int dest_rowstride;
int width, height;
guchar *dest_pixels;
-
+
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, RADIO_SIZE, RADIO_SIZE);
-
+
if (pixbuf == NULL)
return NULL;
-
+
dest_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
dest_pixels = gdk_pixbuf_get_pixels (pixbuf);
-
+
for (y = 0; y < RADIO_SIZE; y++)
{
src = bit + y * RADIO_SIZE;
asrc = alpha + y * RADIO_SIZE;
dest = dest_pixels + y * dest_rowstride;
-
+
for (x = 0; x < RADIO_SIZE; x++)
{
double dr, dg, db;
-
+
intensity = (src[x] + 0 )/ 255.0;
-
+
if (intensity <= 0.5)
{
/* Go from black at intensity = 0.0 to new_color at intensity = 0.5 */
@@ -108,16 +108,16 @@ colorize_bit (unsigned char *bit,
dg = (new_color->green + (65535 - new_color->green) * (intensity - 0.5) * 2.0) / 65535.0;
db = (new_color->blue + (65535 - new_color->blue) * (intensity - 0.5) * 2.0) / 65535.0;
}
-
+
dest[0] = CLAMP_UCHAR (255 * dr);
dest[1] = CLAMP_UCHAR (255 * dg);
dest[2] = CLAMP_UCHAR (255 * db);
-
+
dest[3] = asrc[x];
dest += 4;
}
}
-
+
return pixbuf;
}
@@ -128,23 +128,23 @@ pixbuf_to_pixmap (GtkStyle *style,
{
GdkGC *tmp_gc;
GdkPixmap *pixmap;
-
+
pixmap = gdk_pixmap_new (gdk_screen_get_root_window (screen),
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
style->depth);
-
+
gdk_drawable_set_colormap (pixmap, style->colormap);
-
+
tmp_gc = gdk_gc_new (pixmap);
-
+
gdk_pixbuf_render_to_drawable (pixbuf, pixmap, tmp_gc, 0, 0, 0, 0,
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
GDK_RGB_DITHER_NORMAL, 0, 0);
-
+
gdk_gc_unref (tmp_gc);
-
+
return pixmap;
}
@@ -161,7 +161,7 @@ rgb_to_hls (gdouble *r,
gdouble blue;
gdouble h, l, s;
gdouble delta;
-
+
red = *r;
green = *g;
blue = *b;
@@ -172,7 +172,7 @@ rgb_to_hls (gdouble *r,
max = red;
else
max = blue;
-
+
if (green < blue)
min = green;
else
@@ -184,7 +184,7 @@ rgb_to_hls (gdouble *r,
max = green;
else
max = blue;
-
+
if (red < blue)
min = red;
else
@@ -201,7 +201,7 @@ rgb_to_hls (gdouble *r,
s = (max - min) / (max + min);
else
s = (max - min) / (2 - max - min);
-
+
delta = max -min;
if (red == max)
h = (green - blue) / delta;
@@ -209,7 +209,7 @@ rgb_to_hls (gdouble *r,
h = 2 + (blue - red) / delta;
else if (blue == max)
h = 4 + (red - green) / delta;
-
+
h *= 60;
if (h < 0.0)
h += 360;
@@ -230,7 +230,7 @@ hls_to_rgb (gdouble *h,
gdouble saturation;
gdouble m1, m2;
gdouble r, g, b;
-
+
lightness = *l;
saturation = *s;
@@ -238,7 +238,7 @@ hls_to_rgb (gdouble *h,
m2 = lightness * (1 + saturation);
else
m2 = lightness + saturation - lightness * saturation;
-
+
m1 = 2 * lightness - m2;
if (saturation == 0)
@@ -254,7 +254,7 @@ hls_to_rgb (gdouble *h,
hue -= 360;
while (hue < 0)
hue += 360;
-
+
if (hue < 60)
r = m1 + (m2 - m1) * hue / 60;
else if (hue < 180)
@@ -263,13 +263,13 @@ hls_to_rgb (gdouble *h,
r = m1 + (m2 - m1) * (240 - hue) / 60;
else
r = m1;
-
+
hue = *h;
while (hue > 360)
hue -= 360;
while (hue < 0)
hue += 360;
-
+
if (hue < 60)
g = m1 + (m2 - m1) * hue / 60;
else if (hue < 180)
@@ -278,13 +278,13 @@ hls_to_rgb (gdouble *h,
g = m1 + (m2 - m1) * (240 - hue) / 60;
else
g = m1;
-
+
hue = *h - 120;
while (hue > 360)
hue -= 360;
while (hue < 0)
hue += 360;
-
+
if (hue < 60)
b = m1 + (m2 - m1) * hue / 60;
else if (hue < 180)
@@ -293,7 +293,7 @@ hls_to_rgb (gdouble *h,
b = m1 + (m2 - m1) * (240 - hue) / 60;
else
b = m1;
-
+
*h = r;
*l = g;
*s = b;
@@ -306,27 +306,27 @@ shade (GdkColor * a, GdkColor * b, float k)
gdouble red;
gdouble green;
gdouble blue;
-
+
red = (gdouble) a->red / 65535.0;
green = (gdouble) a->green / 65535.0;
blue = (gdouble) a->blue / 65535.0;
-
+
rgb_to_hls (&red, &green, &blue);
-
+
green *= k;
if (green > 1.0)
green = 1.0;
else if (green < 0.0)
green = 0.0;
-
+
blue *= k;
if (blue > 1.0)
blue = 1.0;
else if (blue < 0.0)
blue = 0.0;
-
+
hls_to_rgb (&red, &green, &blue);
-
+
b->red = red * 65535.0;
b->green = green * 65535.0;
b->blue = blue * 65535.0;
@@ -452,13 +452,13 @@ calculate_arrow_geometry (GtkArrowType arrow_type,
case GTK_ARROW_DOWN:
w += (w % 2) - 1;
h = (w / 2 + 1) + 1;
-
+
if (h > *height)
{
h = *height;
w = 2 * (h - 1) - 1;
}
-
+
if (arrow_type == GTK_ARROW_DOWN)
{
if (*height % 2 == 1 || h % 2 == 0)
@@ -470,18 +470,18 @@ calculate_arrow_geometry (GtkArrowType arrow_type,
*height -= 1;
}
break;
-
+
case GTK_ARROW_RIGHT:
case GTK_ARROW_LEFT:
h += (h % 2) - 1;
w = (h / 2 + 1) + 1;
-
+
if (w > *width)
{
w = *width;
h = 2 * (w - 1) - 1;
}
-
+
if (arrow_type == GTK_ARROW_RIGHT)
{
if (*width % 2 == 1 || w % 2 == 0)
@@ -493,7 +493,7 @@ calculate_arrow_geometry (GtkArrowType arrow_type,
*width -= 1;
}
break;
-
+
default:
/* should not be reached */
break;
@@ -532,7 +532,7 @@ void gtk_clist_get_header_index (GtkCList *clist, GtkWidget *button,
{
*columns = clist->columns;
int i;
-
+
for (i=0; i<*columns; i++)
{
if (clist->column[i].button == button)
@@ -549,7 +549,7 @@ sanitize_size (GdkWindow *window,
gint *height)
{
gboolean set_bg = FALSE;
-
+
if ((*width == -1) && (*height == -1))
{
set_bg = GDK_IS_WINDOW (window);
@@ -559,7 +559,7 @@ sanitize_size (GdkWindow *window,
gdk_window_get_size (window, width, NULL);
else if (*height == -1)
gdk_window_get_size (window, NULL, height);
-
+
return set_bg;
}
@@ -573,11 +573,11 @@ option_menu_get_props (GtkWidget *widget,
{
GtkRequisition *tmp_size = NULL;
GtkBorder *tmp_spacing = NULL;
-
+
if (widget)
gtk_widget_style_get (widget, "indicator_size", &tmp_size,
"indicator_spacing", &tmp_spacing, NULL);
-
+
if (tmp_size)
{
*indicator_size = *tmp_size;
@@ -585,7 +585,7 @@ option_menu_get_props (GtkWidget *widget,
}
else
*indicator_size = default_option_indicator_size;
-
+
if (tmp_spacing)
{
*indicator_spacing = *tmp_spacing;
@@ -651,7 +651,7 @@ internal_color_get_as_uchars(GdkColor *color,
*red = (guchar) (color->red / 256.0);
*green = (guchar) (color->green / 256.0);
*blue = (guchar) (color->blue / 256.0);
-}
+}
static GdkPixbuf*
internal_create_horizontal_gradient_image_buffer (gint width, gint height,
@@ -716,7 +716,7 @@ internal_create_vertical_gradient_image_buffer (gint width, gint height,
gint i, j, max_block, last_block;
long r, g, b, dr, dg, db;
GdkPixbuf *buffer;
-
+
guchar *ptr;
guchar point[4];
@@ -754,7 +754,7 @@ internal_create_vertical_gradient_image_buffer (gint width, gint height,
ptr[0] = r>>16;
ptr[1] = g>>16;
ptr[2] = b>>16;
-
+
if (width > 1)
{
last_block = 0;
@@ -779,7 +779,7 @@ internal_create_vertical_gradient_image_buffer (gint width, gint height,
g += dg;
b += db;
}
-
+
return buffer;
}
@@ -806,15 +806,15 @@ draw_vgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
#endif
{
GdkPixbuf *image_buffer = NULL;
-
+
image_buffer = internal_create_horizontal_gradient_image_buffer (width, height, left_color, right_color);
-
+
if (image_buffer)
{
gdk_draw_pixbuf(drawable, gc, image_buffer, 0, 0, x, y, width, height, GDK_RGB_DITHER_MAX, 0, 0);
g_object_unref(image_buffer);
- }
+ }
}
#ifndef ALWAYS_DITHER_GRADIENTS
else
@@ -825,7 +825,7 @@ draw_vgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
GdkGCValues old_values;
gdk_gc_get_values (gc, &old_values);
-
+
if (left_color == right_color )
{
col = *left_color;
@@ -835,7 +835,7 @@ draw_vgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
gdk_gc_set_foreground (gc, &old_values.foreground);
return;
}
-
+
col = *left_color;
dr = (right_color->red - left_color->red) / width;
dg = (right_color->green - left_color->green) / width;
@@ -844,10 +844,10 @@ draw_vgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
for (i = 0; i < width; i++)
{
gdk_rgb_find_color (style->colormap, &col);
-
+
gdk_gc_set_foreground (gc, &col);
gdk_draw_line (drawable, gc, x + i, y, x + i, y + height - 1);
-
+
col.red += dr;
col.green += dg;
col.blue += db;
@@ -862,11 +862,11 @@ void
draw_hgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
int x, int y, int width, int height,
GdkColor *top_color, GdkColor *bottom_color)
-{
+{
#ifndef ALWAYS_DITHER_GRADIENTS
gboolean dither = ((style->depth > 0) && (style->depth <= 16));
#endif
-
+
if ((width <= 0) || (height <= 0))
return;
@@ -875,15 +875,15 @@ draw_hgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
#endif
{
GdkPixbuf *image_buffer = NULL;
-
+
image_buffer = internal_create_vertical_gradient_image_buffer (width, height, top_color, bottom_color);
-
+
if (image_buffer)
{
gdk_draw_pixbuf(drawable, gc, image_buffer, 0, 0, x, y, width, height, GDK_RGB_DITHER_MAX, 0, 0);
g_object_unref(image_buffer);
- }
+ }
}
#ifndef ALWAYS_DITHER_GRADIENTS
else
@@ -892,7 +892,7 @@ draw_hgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
GdkColor col;
int dr, dg, db;
GdkGCValues old_values;
-
+
gdk_gc_get_values (gc, &old_values);
if (top_color == bottom_color )
@@ -909,14 +909,14 @@ draw_hgradient (GdkDrawable *drawable, GdkGC *gc, GtkStyle *style,
dr = (bottom_color->red - top_color->red) / height;
dg = (bottom_color->green - top_color->green) / height;
db = (bottom_color->blue - top_color->blue) / height;
-
+
for (i = 0; i < height; i++)
{
gdk_rgb_find_color (style->colormap, &col);
-
+
gdk_gc_set_foreground (gc, &col);
gdk_draw_line (drawable, gc, x, y + i, x + width - 1, y + i);
-
+
col.red += dr;
col.green += dg;
col.blue += db;
@@ -934,7 +934,7 @@ void blend (GdkColormap *colormap,
c->red = (a->red * alpha + b->red * inAlpha) / 100;
c->green = (a->green * alpha + b->green * inAlpha) / 100;
c->blue = (a->blue * alpha + b->blue * inAlpha) / 100;
-
+
gdk_rgb_find_color (colormap, c);
}
@@ -962,7 +962,7 @@ GtkWidget *
find_combo_box_widget (GtkWidget * widget)
{
GtkWidget *result = NULL;
-
+
if (widget && !GTK_IS_COMBO_BOX_ENTRY (widget))
{
if (GTK_IS_COMBO_BOX (widget))
@@ -970,7 +970,7 @@ find_combo_box_widget (GtkWidget * widget)
else
result = find_combo_box_widget(widget->parent);
}
-
+
return result;
}
diff --git a/libs/clearlooks-older/support.h b/libs/clearlooks-older/support.h
index ea2417f3cb..646115ede9 100644
--- a/libs/clearlooks-older/support.h
+++ b/libs/clearlooks-older/support.h
@@ -91,13 +91,13 @@ calculate_arrow_geometry (GtkArrowType arrow_type,
gint *y,
gint *width,
gint *height);
-
+
GtkWidget *special_get_ancestor(GtkWidget * widget,
GType widget_type);
-
+
void blend (GdkColormap *colormap,
GdkColor *a, GdkColor *b, GdkColor *c, int alpha);
-
+
GtkWidget *get_parent_window (GtkWidget *widget);
GdkColor *get_parent_bgcolor (GtkWidget *widget);
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp
index 82868cd24c..3784b25720 100644
--- a/libs/evoral/evoral/ControlList.hpp
+++ b/libs/evoral/evoral/ControlList.hpp
@@ -108,7 +108,7 @@ public:
void set_descriptor(const ParameterDescriptor& d) { _desc = d; }
EventList::size_type size() const { return _events.size(); }
- double length() const {
+ double length() const {
Glib::Threads::RWLock::ReaderLock lm (_lock);
return _events.empty() ? 0.0 : _events.back()->when;
}
@@ -126,7 +126,7 @@ public:
virtual void add (double when, double value, bool with_guards=true, bool with_initial=true);
virtual void editor_add (double when, double value, bool with_guard);
-
+
void fast_simple_add (double when, double value);
void erase_range (double start, double end);
diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp
index 57a77afe71..b7d50d7d2e 100644
--- a/libs/evoral/evoral/ControlSet.hpp
+++ b/libs/evoral/evoral/ControlSet.hpp
@@ -77,7 +77,7 @@ protected:
Controls _controls;
PBD::ScopedConnectionList _list_connections;
-
+
private:
PBD::ScopedConnectionList _control_connections;
diff --git a/libs/evoral/evoral/Range.hpp b/libs/evoral/evoral/Range.hpp
index 230b289747..9d47faf30d 100644
--- a/libs/evoral/evoral/Range.hpp
+++ b/libs/evoral/evoral/Range.hpp
@@ -140,7 +140,7 @@ struct /*LIBEVORAL_API*/ Range {
bool empty() const { return from == to; }
};
-template<typename T>
+template<typename T>
bool operator== (Range<T> a, Range<T> b) {
return a.from == b.from && a.to == b.to;
}
@@ -149,7 +149,7 @@ template<typename T>
class /*LIBEVORAL_API*/ RangeList {
public:
RangeList () : _dirty (false) {}
-
+
typedef std::list<Range<T> > List;
List const & get () {
@@ -171,7 +171,7 @@ public:
return;
}
- restart:
+ restart:
for (typename List::iterator i = _list.begin(); i != _list.end(); ++i) {
for (typename List::iterator j = _list.begin(); j != _list.end(); ++j) {
@@ -192,7 +192,7 @@ public:
}
private:
-
+
List _list;
bool _dirty;
};
@@ -225,7 +225,7 @@ RangeList<T> subtract (Range<T> range, RangeList<T> sub)
/* The basic idea here is to keep a list of the result ranges, and subtract
the bits of `sub' from them one by one.
*/
-
+
for (typename RangeList<T>::List::const_iterator i = s.begin(); i != s.end(); ++i) {
/* Here's where we'll put the new current result after subtracting *i from it */
diff --git a/libs/evoral/evoral/TimeConverter.hpp b/libs/evoral/evoral/TimeConverter.hpp
index 23e0823ac9..6c02507c17 100644
--- a/libs/evoral/evoral/TimeConverter.hpp
+++ b/libs/evoral/evoral/TimeConverter.hpp
@@ -50,7 +50,7 @@ public:
B origin_b () const {
return _origin_b;
}
-
+
void set_origin_b (B o) {
_origin_b = o;
}
@@ -68,7 +68,7 @@ template<typename A, typename B>
class LIBEVORAL_TEMPLATE_API IdentityConverter : public TimeConverter<A,B> {
public:
IdentityConverter() {}
-
+
B to(A a) const;
A from(B b) const;
};
diff --git a/libs/evoral/evoral/midi_util.h b/libs/evoral/evoral/midi_util.h
index 9341e1afb2..2ad5b3f328 100644
--- a/libs/evoral/evoral/midi_util.h
+++ b/libs/evoral/evoral/midi_util.h
@@ -93,7 +93,7 @@ midi_event_size(const uint8_t* buffer)
// see http://www.midi.org/techspecs/midimessages.php
if (status == MIDI_CMD_COMMON_SYSEX) {
int end;
-
+
for (end = 1; buffer[end] != MIDI_CMD_COMMON_SYSEX_END; end++) {
if ((buffer[end] & 0x80) != 0) {
return -1;
diff --git a/libs/evoral/src/Control.cpp b/libs/evoral/src/Control.cpp
index 68858cd145..a6cd374c54 100644
--- a/libs/evoral/src/Control.cpp
+++ b/libs/evoral/src/Control.cpp
@@ -54,7 +54,7 @@ void
Control::set_double (double value, double frame, bool to_list)
{
_user_value = value;
-
+
/* if we're in a write pass, the automation watcher will determine the
values and add them to the list, so we we don't need to bother.
*/
@@ -69,7 +69,7 @@ void
Control::set_list(boost::shared_ptr<ControlList> list)
{
_list_marked_dirty_connection.disconnect ();
-
+
_list = list;
if (_list) {
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index 0755bd27d2..d8665d3396 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -165,7 +165,7 @@ ControlList::operator= (const ControlList& other)
_interpolation = other._interpolation;
_default_value = other._default_value;
-
+
copy_events (other);
}
@@ -269,49 +269,49 @@ ControlList::thin (double thinning_factor)
{
Glib::Threads::RWLock::WriterLock lm (_lock);
-
+
ControlEvent* prevprev = 0;
ControlEvent* cur = 0;
ControlEvent* prev = 0;
iterator pprev;
int counter = 0;
-
+
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 thin from %2 events\n", this, _events.size()));
-
+
for (iterator i = _events.begin(); i != _events.end(); ++i) {
-
+
cur = *i;
counter++;
-
+
if (counter > 2) {
-
+
/* compute the area of the triangle formed by 3 points
*/
-
+
double area = fabs ((prevprev->when * (prev->value - cur->value)) +
(prev->when * (cur->value - prevprev->value)) +
(cur->when * (prevprev->value - prev->value)));
-
+
if (area < thinning_factor) {
iterator tmp = pprev;
-
+
/* pprev will change to current
i is incremented to the next event
as we loop.
*/
-
+
pprev = i;
_events.erase (tmp);
changed = true;
continue;
}
}
-
+
prevprev = prev;
prev = cur;
pprev = i;
}
-
+
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 thin => %2 events\n", this, _events.size()));
if (changed) {
@@ -358,12 +358,12 @@ ControlList::start_write_pass (double when)
new_write_pass = true;
did_write_during_pass = false;
insert_position = when;
-
+
/* leave the insert iterator invalid, so that we will do the lookup
of where it should be in a "lazy" way - deferring it until
we actually add the first point (which may never happen).
*/
-
+
unlocked_invalidate_insert_iterator ();
}
@@ -382,9 +382,9 @@ ControlList::write_pass_finished (double /*when*/, double thinning_factor)
void
ControlList::set_in_write_pass (bool yn, bool add_point, double when)
-{
+{
DEBUG_TRACE (DEBUG::ControlList, string_compose ("now in write pass @ %1, add point ? %2\n", when, add_point));
-
+
_in_write_pass = yn;
if (yn && add_point) {
@@ -401,19 +401,19 @@ ControlList::add_guard_point (double when)
double eval_value = unlocked_eval (insert_position);
if (most_recent_insert_iterator == _events.end()) {
-
+
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 insert iterator at end, adding eval-value there %2\n", this, eval_value));
_events.push_back (new ControlEvent (when, eval_value));
/* leave insert iterator at the end */
-
+
} else if ((*most_recent_insert_iterator)->when == when) {
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 insert iterator at existing point, setting eval-value there %2\n", this, eval_value));
-
+
/* most_recent_insert_iterator points to a control event
already at the insert position, so there is
nothing to do.
-
+
... except ...
advance most_recent_insert_iterator so that the "real"
@@ -426,22 +426,22 @@ ControlList::add_guard_point (double when)
/* insert a new control event at the right spot
*/
-
+
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 insert eval-value %2 just before iterator @ %3\n",
this, eval_value, (*most_recent_insert_iterator)->when));
-
+
most_recent_insert_iterator = _events.insert (most_recent_insert_iterator, new ControlEvent (when, eval_value));
/* advance most_recent_insert_iterator so that the "real"
* insert occurs in the right place, since it
* points to the control event just inserted.
*/
-
+
++most_recent_insert_iterator;
}
-
+
/* don't do this again till the next write pass */
-
+
new_write_pass = false;
}
@@ -458,7 +458,7 @@ ControlList::editor_add (double when, double value, bool with_guard)
*/
if (_events.empty()) {
-
+
/* as long as the point we're adding is not at zero,
* add an "anchor" point there.
*/
@@ -570,7 +570,7 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial
iterator insertion_point;
if (_events.empty() && with_initial) {
-
+
/* empty: add an "anchor" point if the point we're adding past time 0 */
if (when >= 1) {
@@ -609,7 +609,7 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial
}
} else if (!_in_write_pass) {
-
+
/* not in a write pass: figure out the iterator we should insert in front of */
DEBUG_TRACE (DEBUG::ControlList, string_compose ("compute(b) MRI for position %1\n", when));
@@ -621,7 +621,7 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial
if (most_recent_insert_iterator == _events.end()) {
DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 appending new point at end\n", this));
-
+
const bool done = maybe_insert_straight_line (when, value);
if (!done) {
_events.push_back (new ControlEvent (when, value));
@@ -1032,7 +1032,7 @@ ControlList::truncate_end (double last_coordinate)
_events.back()->when = last_coordinate;
_events.back()->value = last_val;
}
-
+
unlocked_invalidate_insert_iterator ();
mark_dirty();
}
@@ -1767,7 +1767,7 @@ ControlList::operator!= (ControlList const & other) const
if (i != _events.end ()) {
return true;
}
-
+
return (
_parameter != other._parameter ||
_interpolation != other._interpolation ||
diff --git a/libs/evoral/src/Curve.cpp b/libs/evoral/src/Curve.cpp
index aed972659b..8a4aa470c1 100644
--- a/libs/evoral/src/Curve.cpp
+++ b/libs/evoral/src/Curve.cpp
@@ -221,7 +221,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen)
min_x = _list.events().front()->when;
if (x0 > max_x) {
- /* totally past the end - just fill the entire array with the final value */
+ /* totally past the end - just fill the entire array with the final value */
for (int32_t i = 0; i < veclen; ++i) {
vec[i] = _list.events().back()->value;
}
diff --git a/libs/evoral/src/Event.cpp b/libs/evoral/src/Event.cpp
index a1dc24ff0d..86b70da87d 100644
--- a/libs/evoral/src/Event.cpp
+++ b/libs/evoral/src/Event.cpp
@@ -167,7 +167,7 @@ Event<Timestamp>::set_original_time (Timestamp t)
{
_original_time = t;
}
-
+
#endif // EVORAL_EVENT_ALLOC
template class Event<Evoral::Beats>;
diff --git a/libs/evoral/src/Note.cpp b/libs/evoral/src/Note.cpp
index 7e4f58d73f..afd7330325 100644
--- a/libs/evoral/src/Note.cpp
+++ b/libs/evoral/src/Note.cpp
@@ -68,7 +68,7 @@ Note<Time>::Note(const Note<Time>& copy)
_off_event.buffer = _off_event_buffer;
memcpy(_off_event_buffer, copy._off_event_buffer, 3);
*/
-
+
assert(time() == copy.time());
assert(end_time() == copy.end_time());
assert(length() == copy.length());
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index 0b3d4ac8e1..7f032487b1 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -723,7 +723,7 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note)
*/
typename Sequence<Time>::Notes::iterator i;
-
+
for (i = note_lower_bound(note->time()); i != _notes.end() && (*i)->time() == note->time(); ++i) {
if (*i == note) {
@@ -763,19 +763,19 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note)
* in this scenario, we have no choice other than to linear
* search the list of notes and find the note by ID.
*/
-
+
for (i = _notes.begin(); i != _notes.end(); ++i) {
if ((*i)->id() == note->id()) {
-
+
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1\tID-based pass, erasing note #%2 %3 @ %4\n", this, (*i)->id(), (int)(*i)->note(), (*i)->time()));
_notes.erase (i);
-
+
if (note->note() == _lowest_note || note->note() == _highest_note) {
-
+
_lowest_note = 127;
_highest_note = 0;
-
+
for (typename Sequence<Time>::Notes::iterator ii = _notes.begin(); ii != _notes.end(); ++ii) {
if ((*ii)->note() < _lowest_note)
_lowest_note = (*ii)->note();
@@ -783,18 +783,18 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note)
_highest_note = (*ii)->note();
}
}
-
+
erased = true;
id_matched = true;
break;
}
}
}
-
+
if (erased) {
Pitches& p (pitches (note->channel()));
-
+
typename Pitches::iterator j;
/* if we had to ID-match above, we can't expect to find it in
@@ -818,11 +818,11 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note)
* notes by channel+time. We care only about its note number
* so the search_note has all other properties unset.
*/
-
+
NotePtr search_note (new Note<Time>(0, Time(), Time(), note->note(), 0));
for (j = p.lower_bound (search_note); j != p.end() && (*j)->note() == note->note(); ++j) {
-
+
if ((*j) == note) {
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1\terasing pitch %2 @ %3\n", this, (int)(*j)->note(), (*j)->time()));
p.erase (j);
@@ -836,7 +836,7 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note)
}
_edited = true;
-
+
} else {
cerr << "Unable to find note to erase matching " << *note.get() << endmsg;
}
diff --git a/libs/evoral/src/libsmf/smf.c b/libs/evoral/src/libsmf/smf.c
index 67cc7b889e..9117751f54 100644
--- a/libs/evoral/src/libsmf/smf.c
+++ b/libs/evoral/src/libsmf/smf.c
@@ -180,7 +180,7 @@ smf_add_track(smf_t *smf, smf_track_t *track)
#else
smf_set_format(smf, 1);
#endif
-
+
}
}
diff --git a/libs/evoral/src/libsmf/smf_decode.c b/libs/evoral/src/libsmf/smf_decode.c
index d527cf178a..5555fdcace 100644
--- a/libs/evoral/src/libsmf/smf_decode.c
+++ b/libs/evoral/src/libsmf/smf_decode.c
@@ -58,7 +58,7 @@ smf_event_is_metadata(const smf_event_t *event)
{
assert(event->midi_buffer);
assert(event->midi_buffer_length > 0);
-
+
if (event->midi_buffer[0] == 0xFF)
return (1);
@@ -76,7 +76,7 @@ smf_event_is_system_realtime(const smf_event_t *event)
if (smf_event_is_metadata(event))
return (0);
-
+
if (event->midi_buffer[0] >= 0xF8)
return (1);
@@ -105,7 +105,7 @@ smf_event_is_sysex(const smf_event_t *event)
{
assert(event->midi_buffer);
assert(event->midi_buffer_length > 0);
-
+
if (event->midi_buffer[0] == 0xF0)
return (1);
diff --git a/libs/evoral/src/libsmf/smf_load.c b/libs/evoral/src/libsmf/smf_load.c
index 96b36fdbb5..a23a88fa49 100644
--- a/libs/evoral/src/libsmf/smf_load.c
+++ b/libs/evoral/src/libsmf/smf_load.c
@@ -126,7 +126,7 @@ parse_mthd_header(smf_t *smf)
if (!chunk_signature_matches(tmp_mthd, "MThd")) {
g_critical("SMF error: MThd signature not found, is that a MIDI file?");
-
+
return (-2);
}
@@ -199,7 +199,7 @@ parse_mthd_chunk(smf_t *smf)
g_critical("SMF file uses FPS timing instead of PPQN, no support for that yet.");
return (-4);
}
-
+
return (0);
}
@@ -372,7 +372,7 @@ expected_message_length(unsigned char status, const unsigned char *second_byte,
case 0xA0: /* AfterTouch. */
case 0xB0: /* Control Change. */
case 0xE0: /* Pitch Wheel. */
- return (3);
+ return (3);
case 0xC0: /* Program Change. */
case 0xD0: /* Channel Pressure. */
@@ -388,7 +388,7 @@ static int
extract_sysex_event(const unsigned char *buf, const size_t buffer_length, smf_event_t *event, uint32_t *len, int last_status)
{
(void) last_status;
-
+
int status;
int32_t vlq_length, message_length;
const unsigned char *c = buf;
@@ -433,7 +433,7 @@ static int
extract_escaped_event(const unsigned char *buf, const size_t buffer_length, smf_event_t *event, uint32_t *len, int last_status)
{
(void) last_status;
-
+
int status;
int32_t message_length = 0;
int32_t vlq_length = 0;
@@ -709,7 +709,7 @@ parse_mtrk_header(smf_track_t *track)
if (!chunk_signature_matches(mtrk, "MTrk")) {
g_warning("SMF warning: Expected MTrk signature, got %c%c%c%c instead; ignoring this chunk.",
mtrk->id[0], mtrk->id[1], mtrk->id[2], mtrk->id[3]);
-
+
return (-2);
}
@@ -741,7 +741,7 @@ smf_event_length_is_valid(const smf_event_t *event)
{
assert(event);
assert(event->midi_buffer);
-
+
int32_t expected;
if (event->midi_buffer_length < 1)
@@ -854,7 +854,7 @@ load_file_into_buffer(void **file_buffer, size_t *file_buffer_length, FILE* stre
*file_buffer = malloc(*file_buffer_length);
if (*file_buffer == NULL) {
g_critical("malloc(3) failed: %s", strerror(errno));
-
+
return (-5);
}
@@ -864,7 +864,7 @@ load_file_into_buffer(void **file_buffer, size_t *file_buffer_length, FILE* stre
*file_buffer = NULL;
return (-6);
}
-
+
return (0);
}
diff --git a/libs/evoral/src/libsmf/smf_save.c b/libs/evoral/src/libsmf/smf_save.c
index 7c5747a3d5..6463955dba 100644
--- a/libs/evoral/src/libsmf/smf_save.c
+++ b/libs/evoral/src/libsmf/smf_save.c
@@ -539,7 +539,7 @@ smf_validate(smf_t *smf)
return (-6);
}
}
-
+
}
return (0);
diff --git a/libs/evoral/src/libsmf/smf_tempo.c b/libs/evoral/src/libsmf/smf_tempo.c
index fb38ad0933..c172314815 100644
--- a/libs/evoral/src/libsmf/smf_tempo.c
+++ b/libs/evoral/src/libsmf/smf_tempo.c
@@ -241,7 +241,7 @@ smf_create_tempo_map_and_compute_seconds(smf_t *smf)
for (;;) {
event = smf_get_next_event(smf);
-
+
if (event == NULL)
return;
@@ -275,7 +275,7 @@ smf_get_tempo_by_pulses(const smf_t *smf, size_t pulses)
return (smf_get_tempo_by_number(smf, 0));
assert(smf->tempo_array != NULL);
-
+
for (i = smf->tempo_array->len; i > 0; i--) {
tempo = smf_get_tempo_by_number(smf, i - 1);
@@ -302,7 +302,7 @@ smf_get_tempo_by_seconds(const smf_t *smf, double seconds)
return (smf_get_tempo_by_number(smf, 0));
assert(smf->tempo_array != NULL);
-
+
for (i = smf->tempo_array->len; i > 0; i--) {
tempo = smf_get_tempo_by_number(smf, i - 1);
diff --git a/libs/evoral/src/libsmf/smfsh.c b/libs/evoral/src/libsmf/smfsh.c
index 139b676eaf..493c664bd2 100644
--- a/libs/evoral/src/libsmf/smfsh.c
+++ b/libs/evoral/src/libsmf/smfsh.c
@@ -177,7 +177,7 @@ cmd_ppqn(char *new_ppqn)
g_message("Pulses Per Quarter Note changed to %d.", smf->ppqn);
}
-
+
return (0);
}
@@ -208,7 +208,7 @@ cmd_format(char *new_format)
g_message("Forma changed to %d.", smf->format);
}
-
+
return (0);
}
@@ -343,7 +343,7 @@ show_event(smf_event_t *event)
type = "Metadata";
else
type = "Event";
-
+
decoded = smf_event_decode(event);
if (decoded == NULL) {
diff --git a/libs/evoral/test/CurveTest.cpp b/libs/evoral/test/CurveTest.cpp
index e7634f3602..07b4184833 100644
--- a/libs/evoral/test/CurveTest.cpp
+++ b/libs/evoral/test/CurveTest.cpp
@@ -334,7 +334,7 @@ CurveTest::constrainedCubic ()
f"2(x2) = 2*(2*f'2(x2) + f'2(x1))/(x2 – x1) - 6*(y2 – y1)/ (x2 – x1)^2
= 2*(2*0 + 1.8181)/(30 – 10) – 6*(150 – 130)/(30 – 10)^2
= -0.11818
-
+
d2 = 1/6 * (f"2(x2) - f"2(x1))/(x2 – x1)
= 1/6 * (-0.11818 + 0.063636)/(30 – 10)
= -0.0004545
diff --git a/libs/evoral/test/RangeTest.hpp b/libs/evoral/test/RangeTest.hpp
index 2caea410e6..b06a477b4d 100644
--- a/libs/evoral/test/RangeTest.hpp
+++ b/libs/evoral/test/RangeTest.hpp
@@ -23,4 +23,4 @@ public:
void coverageTest ();
};
-
+
diff --git a/libs/gtkmm2ext/actions.cc b/libs/gtkmm2ext/actions.cc
index a4c8be1774..9471067de9 100644
--- a/libs/gtkmm2ext/actions.cc
+++ b/libs/gtkmm2ext/actions.cc
@@ -259,7 +259,7 @@ ActionManager::enable_accelerators ()
for (acts = gtk_action_group_list_actions (group); acts; acts = g_list_next (acts)) {
ui_string += "<accelerator action=\"";
-
+
/* OK, this is pretty stupid ... there is the full
* accel path returned by gtk_action_get_accel_path ()
* but of course the UIManager doesn't use that, but
@@ -338,7 +338,7 @@ ActionManager::disable_active_actions ()
}
// save all action's states to action_states_to_restore
save_action_states ();
-
+
// set all action's states disabled
for (ActionStates::iterator i = action_states_to_restore.begin(); i != action_states_to_restore.end(); ++i) {
if ((*i).sensitive) {
@@ -391,7 +391,7 @@ ActionManager::get_action (const char* path)
*slash = '\0';
return get_action (&copy[0], ++slash);
-
+
}
RefPtr<Action>
@@ -493,7 +493,7 @@ void
ActionManager::set_toggleaction_state (string n, bool s)
{
char const * name = n.c_str ();
-
+
const char *last_slash = strrchr (name, '/');
if (last_slash == 0) {
@@ -526,13 +526,13 @@ string
ActionManager::get_key_representation (const string& accel_path, AccelKey& key)
{
bool known = lookup_entry (accel_path, key);
-
+
if (known) {
uint32_t k = possibly_translate_legal_accelerator_to_real_key (key.get_key());
key = AccelKey (k, Gdk::ModifierType (key.get_mod()));
return ui_manager->get_accel_group()->get_label (key.get_key(), Gdk::ModifierType (key.get_mod()));
}
-
+
return unbound_string;
}
diff --git a/libs/gtkmm2ext/binding_proxy.cc b/libs/gtkmm2ext/binding_proxy.cc
index 87473adcd2..dfa2b4ac7c 100644
--- a/libs/gtkmm2ext/binding_proxy.cc
+++ b/libs/gtkmm2ext/binding_proxy.cc
@@ -37,12 +37,12 @@ guint BindingProxy::bind_statemask = Gdk::CONTROL_MASK;
BindingProxy::BindingProxy (boost::shared_ptr<Controllable> c)
: prompter (0),
controllable (c)
-{
+{
}
BindingProxy::BindingProxy ()
: prompter (0)
-{
+{
}
BindingProxy::~BindingProxy ()
@@ -89,7 +89,7 @@ BindingProxy::button_press_handler (GdkEventButton *ev)
}
return true;
}
-
+
return false;
}
diff --git a/libs/gtkmm2ext/cairo_packer.cc b/libs/gtkmm2ext/cairo_packer.cc
index d9449ebb6b..71f35fcf36 100644
--- a/libs/gtkmm2ext/cairo_packer.cc
+++ b/libs/gtkmm2ext/cairo_packer.cc
@@ -27,9 +27,9 @@ CairoPacker::draw_background (Gtk::Widget& w, GdkEventExpose*)
int x, y;
Gtk::Widget* window_parent;
Glib::RefPtr<Gdk::Window> win = Gtkmm2ext::window_to_draw_on (w, &window_parent);
-
+
if (win) {
-
+
Cairo::RefPtr<Cairo::Context> context = win->create_cairo_context();
w.translate_coordinates (*window_parent, 0, 0, x, y);
diff --git a/libs/gtkmm2ext/cairo_widget.cc b/libs/gtkmm2ext/cairo_widget.cc
index aa8f883a7d..a597a7e29d 100644
--- a/libs/gtkmm2ext/cairo_widget.cc
+++ b/libs/gtkmm2ext/cairo_widget.cc
@@ -38,7 +38,7 @@ void CairoWidget::set_source_rgb_a( cairo_t* cr, Gdk::Color col, float a) //ToD
float r = col.get_red_p ();
float g = col.get_green_p ();
float b = col.get_blue_p ();
-
+
cairo_set_source_rgba(cr, r, g, b, a);
}
@@ -139,9 +139,9 @@ CairoWidget::on_expose_event (GdkEventExpose *ev)
cairo_context->paint ();
}
#endif
-
+
Gtk::Widget* child = get_child ();
-
+
if (child) {
propagate_expose (*child, ev);
}
@@ -187,9 +187,9 @@ CairoWidget::on_expose_event (GdkEventExpose *ev)
/* paint expose area the color of the parent window bg
*/
-
+
Gdk::Color bg (get_parent_bg());
-
+
cr->set_source_rgb (bg.get_red_p(), bg.get_green_p(), bg.get_blue_p());
cr->fill ();
@@ -219,7 +219,7 @@ CairoWidget::on_expose_event (GdkEventExpose *ev)
#ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
}
#endif
-
+
return true;
}
diff --git a/libs/gtkmm2ext/cairocell.cc b/libs/gtkmm2ext/cairocell.cc
index 4a6056e192..4de898c832 100644
--- a/libs/gtkmm2ext/cairocell.cc
+++ b/libs/gtkmm2ext/cairocell.cc
@@ -149,9 +149,9 @@ CairoTextCell::set_size (Cairo::RefPtr<Cairo::Context>& context)
for (n = 0; n < lim; ++n) {
buf[n] = '0' + digit;
}
-
+
context->get_text_extents (&buf[0], ext);
-
+
max_width = max (ext.width + ext.x_bearing, max_width);
max_height = max (ext.height, max_height);
bsum += ext.x_bearing;
@@ -179,7 +179,7 @@ CairoCharCell::set_size (Cairo::RefPtr<Cairo::Context>& context)
Cairo::TextExtents ext;
_font->apply (context);
-
+
{
const char* buf = "8";
context->get_text_extents (buf, ext);
@@ -251,7 +251,7 @@ void
CairoEditableText::add_cell (CairoCell* cell)
{
cells.push_back (cell);
-
+
CairoTextCell* tc = dynamic_cast<CairoTextCell*>(cell);
if (tc) {
@@ -306,7 +306,7 @@ CairoEditableText::on_expose_event (GdkEventExpose* ev)
Gtk::Allocation alloc = get_allocation ();
double width = alloc.get_width();
double height = alloc.get_height ();
-
+
if (_draw_bg) {
context->set_source_rgba (bg_r, bg_g, bg_b, bg_a);
if (_corner_radius) {
@@ -316,14 +316,14 @@ CairoEditableText::on_expose_event (GdkEventExpose* ev)
}
context->fill ();
}
-
+
for (CellMap::iterator i = cells.begin(); i != cells.end(); ++i) {
CairoCell* cell = (*i);
/* is cell inside the expose area?
*/
-
+
if (cell->intersects (ev->area)) {
if (cell == editing_cell) {
context->set_source_rgba (edit_r, edit_b, edit_g, edit_a);
@@ -413,9 +413,9 @@ CairoEditableText::set_cell_sizes ()
if (!win) {
return;
}
-
+
Cairo::RefPtr<Cairo::Context> context = win->create_cairo_context();
-
+
if (!context) {
return;
}
@@ -432,7 +432,7 @@ CairoEditableText::on_size_request (GtkRequisition* req)
max_cell_width = 0;
max_cell_height = 0;
-
+
for (CellMap::iterator i = cells.begin(); i != cells.end(); ++i) {
max_cell_width += (*i)->width();
max_cell_height = std::max ((double) (*i)->height(), max_cell_height);
diff --git a/libs/gtkmm2ext/cell_renderer_color_selector.cc b/libs/gtkmm2ext/cell_renderer_color_selector.cc
index 62419b423d..f8093cca1d 100644
--- a/libs/gtkmm2ext/cell_renderer_color_selector.cc
+++ b/libs/gtkmm2ext/cell_renderer_color_selector.cc
@@ -46,7 +46,7 @@ CellRendererColorSelector::CellRendererColorSelector()
c.set_red (0);
c.set_green (0);
c.set_blue (0);
-
+
property_color() = c;
}
@@ -70,21 +70,21 @@ CellRendererColorSelector::render_vfunc (const Glib::RefPtr<Gdk::Drawable>& wind
cairo_t* cr = gdk_cairo_create (window->gobj());
double r, g, b;
Gdk::Color c = _property_color.get_value();
-
+
cairo_rectangle (cr, expose_area.get_x(), expose_area.get_y(), expose_area.get_width(), expose_area.get_height());
cairo_clip (cr);
-
+
r = c.get_red_p();
g = c.get_green_p();
b = c.get_blue_p();
-
+
cairo_rectangle_t drawing_rect;
-
+
drawing_rect.x = cell_area.get_x() + property_xpad();
drawing_rect.y = cell_area.get_y() + property_ypad();
drawing_rect.width = cell_area.get_width() - (2 * property_xpad());
drawing_rect.height = cell_area.get_height() - (2 * property_ypad());
-
+
Gtkmm2ext::rounded_rectangle (cr, drawing_rect.x, drawing_rect.y, drawing_rect.width, drawing_rect.height, 5);
cairo_set_source_rgb (cr, r, g, b);
cairo_fill (cr);
diff --git a/libs/gtkmm2ext/cell_renderer_pixbuf_multi.cc b/libs/gtkmm2ext/cell_renderer_pixbuf_multi.cc
index c5c9eb98b0..181e0db0f7 100644
--- a/libs/gtkmm2ext/cell_renderer_pixbuf_multi.cc
+++ b/libs/gtkmm2ext/cell_renderer_pixbuf_multi.cc
@@ -70,7 +70,7 @@ CellRendererPixbufMulti::render_vfunc (const Glib::RefPtr<Gdk::Drawable>& window
offset_width = cell_area.get_x() + (int)(cell_area.get_width() - pb->get_width())/2;
offset_height = cell_area.get_y() + (int)(cell_area.get_height() - pb->get_height())/2;
-
+
window->draw_pixbuf (RefPtr<GC>(), pb, 0, 0, offset_width, offset_height, -1, -1, Gdk::RGB_DITHER_NORMAL, 0, 0);
}
diff --git a/libs/gtkmm2ext/cell_renderer_pixbuf_toggle.cc b/libs/gtkmm2ext/cell_renderer_pixbuf_toggle.cc
index 9fefbfb88e..af709b488f 100644
--- a/libs/gtkmm2ext/cell_renderer_pixbuf_toggle.cc
+++ b/libs/gtkmm2ext/cell_renderer_pixbuf_toggle.cc
@@ -75,7 +75,7 @@ CellRendererPixbufToggle::render_vfunc (const Glib::RefPtr<Gdk::Drawable>& windo
{
int offset_width = 0;
int offset_height = 0;
-
+
if(property_active() == true){
offset_width = cell_area.get_x() + (int)(cell_area.get_width() - inactive_pixbuf->get_width())/2;
diff --git a/libs/gtkmm2ext/choice.cc b/libs/gtkmm2ext/choice.cc
index 4cce090bcc..5dde9426e7 100644
--- a/libs/gtkmm2ext/choice.cc
+++ b/libs/gtkmm2ext/choice.cc
@@ -31,7 +31,7 @@ Choice::Choice (string title, string prompt, vector<string> choices, bool center
{
int n;
vector<string>::iterator i;
-
+
if (center) {
set_position (Gtk::WIN_POS_CENTER);
} else {
@@ -49,7 +49,7 @@ Choice::Choice (string title, string prompt, vector<string> choices, bool center
get_vbox()->set_border_width (12);
get_vbox()->pack_start (*dhbox, true, false);
-
+
set_has_separator (false);
set_resizable (false);
show_all_children ();
diff --git a/libs/gtkmm2ext/click_box.cc b/libs/gtkmm2ext/click_box.cc
index 8782acaae8..876c68f665 100644
--- a/libs/gtkmm2ext/click_box.cc
+++ b/libs/gtkmm2ext/click_box.cc
@@ -135,21 +135,21 @@ ClickBox::on_expose_event (GdkEventExpose *ev)
Glib::RefPtr<Gdk::GC> fg_gc (style->get_fg_gc (Gtk::STATE_NORMAL));
Glib::RefPtr<Gdk::GC> bg_gc (style->get_bg_gc (Gtk::STATE_NORMAL));
Glib::RefPtr<Gdk::Window> win (get_window());
-
+
GdkRectangle base_rect;
GdkRectangle draw_rect;
gint x, y, width, height, depth;
-
+
win->get_geometry (x, y, width, height, depth);
-
+
base_rect.width = width;
base_rect.height = height;
base_rect.x = 0;
base_rect.y = 0;
-
+
gdk_rectangle_intersect (&ev->area, &base_rect, &draw_rect);
win->draw_rectangle (bg_gc, true, draw_rect.x, draw_rect.y, draw_rect.width, draw_rect.height);
-
+
if (twidth && theight) {
win->draw_layout (fg_gc, (width - twidth) / 2, (height - theight) / 2, layout);
}
diff --git a/libs/gtkmm2ext/dndtreeview.cc b/libs/gtkmm2ext/dndtreeview.cc
index 06d17fce40..53b212d711 100644
--- a/libs/gtkmm2ext/dndtreeview.cc
+++ b/libs/gtkmm2ext/dndtreeview.cc
@@ -49,10 +49,10 @@ DnDTreeViewBase::add_drop_targets (list<TargetEntry>& targets)
for (list<TargetEntry>::iterator i = targets.begin(); i != targets.end(); ++i) {
draggable.push_back (*i);
}
-
+
enable_model_drag_source (draggable);
enable_model_drag_dest (draggable);
-}
+}
void
DnDTreeViewBase::add_object_drag (int column, string type_name)
diff --git a/libs/gtkmm2ext/fader.cc b/libs/gtkmm2ext/fader.cc
index a899e5906a..9a2f5a2cd9 100644
--- a/libs/gtkmm2ext/fader.cc
+++ b/libs/gtkmm2ext/fader.cc
@@ -162,7 +162,7 @@ Fader::get_image_scales (double &x_scale, double &y_scale)
int pbheight = _face_pixbuf->get_height ();
int width = get_width ();
int height = get_height ();
-
+
if ((width != pbwidth) || (height != pbheight)) {
x_scale = double (width) / double (pbwidth);
if (x_scale == 0.0) {
@@ -186,17 +186,17 @@ Fader::set_touch_cursor (const Glib::RefPtr<Gdk::Pixbuf>& touch_cursor)
void
Fader::render (cairo_t* cr, cairo_rectangle_t*)
{
-
+
double xscale = 1.0;
double yscale = 1.0;
-
+
get_image_scales (xscale, yscale);
-
+
cairo_matrix_t matrix;
cairo_get_matrix (cr, &matrix);
cairo_matrix_scale (&matrix, xscale, yscale);
cairo_set_matrix (cr, &matrix);
-
+
get_handle_position (_last_drawn_x, _last_drawn_y);
if (_underlay_pixbuf != 0) {
@@ -264,9 +264,9 @@ Fader::on_button_press_event (GdkEventButton* ev)
double xscale = 1.0;
double yscale = 1.0;
-
+
get_image_scales (xscale, yscale);
-
+
double hw = _handle_pixbuf->get_width() * xscale;
double hh = _handle_pixbuf->get_height() * yscale;
@@ -276,16 +276,16 @@ Fader::on_button_press_event (GdkEventButton* ev)
double ev_pos_x;
double ev_pos_y;
-
+
get_closest_point_on_line(_min_pos_x, _min_pos_y,
_max_pos_x, _max_pos_y,
ev->x, ev->y,
ev_pos_x, ev_pos_y );
add_modal_grab ();
-
+
_grab_window = ev->window;
_dragging = true;
-
+
gdk_pointer_grab(ev->window,false,
GdkEventMask (Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK),
NULL,
@@ -293,7 +293,7 @@ Fader::on_button_press_event (GdkEventButton* ev)
ev->time);
queue_draw();
-
+
return true;
}
@@ -368,7 +368,7 @@ Fader::on_motion_notify_event (GdkEventMotion* ev)
if (_dragging) {
double ev_pos_x;
double ev_pos_y;
-
+
if (ev->window != _grab_window) {
_grab_window = ev->window;
return true;
@@ -378,12 +378,12 @@ Fader::on_motion_notify_event (GdkEventMotion* ev)
_max_pos_x, _max_pos_y,
_grab_start_handle_x + (ev->x - _grab_start_mouse_x), _grab_start_handle_y + (ev->y - _grab_start_mouse_y),
ev_pos_x, ev_pos_y );
-
+
double const fract = sqrt((ev_pos_x - _min_pos_x) * (ev_pos_x - _min_pos_x) +
(ev_pos_y - _min_pos_y) * (ev_pos_y - _min_pos_y)) /
sqrt((double)((_max_pos_x - _min_pos_x) * (_max_pos_x - _min_pos_x) +
(_max_pos_y - _min_pos_y) * (_max_pos_y - _min_pos_y)));
-
+
adjustment.set_value (adjustment.get_lower() + (adjustment.get_upper() - adjustment.get_lower()) * fract);
}
return true;
diff --git a/libs/gtkmm2ext/grouped_buttons.cc b/libs/gtkmm2ext/grouped_buttons.cc
index e9d2c1c422..48a2ed1ab0 100644
--- a/libs/gtkmm2ext/grouped_buttons.cc
+++ b/libs/gtkmm2ext/grouped_buttons.cc
@@ -46,9 +46,9 @@ GroupedButtons::GroupedButtons (uint32_t nbuttons, uint32_t first_active)
for (uint32_t n = 0; n < nbuttons; ++n) {
Gtk::ToggleButton *button;
-
+
button = manage (new (Gtk::ToggleButton));
-
+
if (n == current_active) {
button->set_active (true);
}
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc
index d06e60ccd6..d160146859 100644
--- a/libs/gtkmm2ext/gtk_ui.cc
+++ b/libs/gtkmm2ext/gtk_ui.cc
@@ -71,12 +71,12 @@ UI::UI (string namestr, int *argc, char ***argv)
: AbstractUI<UIRequest> (namestr)
, _receiver (*this)
, errors (0)
-
+
{
theMain = new Main (argc, argv);
pthread_set_name ("gui");
-
+
_active = false;
if (!theGtkUI) {
@@ -91,7 +91,7 @@ UI::UI (string namestr, int *argc, char ***argv)
*/
run_loop_thread = Threads::Thread::self();
-
+
/* store "this" as the UI-for-thread of this thread, same argument
as for previous line.
*/
@@ -144,7 +144,7 @@ UI::load_rcfile (string path, bool themechange)
* This does not occur if wiget.get_style is used instead of rc.get_style below,
* except that doesn't actually work...
*/
-
+
static Glib::RefPtr<Style>* fatal_style = 0;
static Glib::RefPtr<Style>* error_style = 0;
static Glib::RefPtr<Style>* warning_style = 0;
@@ -641,7 +641,7 @@ UI::toggle_errors ()
}
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
-
+
if (tact->get_active()) {
errors->set_position (WIN_POS_MOUSE);
errors->show ();
diff --git a/libs/gtkmm2ext/gtkmm2ext/actions.h b/libs/gtkmm2ext/gtkmm2ext/actions.h
index 0336fde242..b03e351cbf 100644
--- a/libs/gtkmm2ext/gtkmm2ext/actions.h
+++ b/libs/gtkmm2ext/gtkmm2ext/actions.h
@@ -38,7 +38,7 @@ namespace ActionManager {
LIBGTKMM2EXT_API extern std::string unbound_string; /* the key string returned if an action is not bound */
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::UIManager> ui_manager;
-
+
LIBGTKMM2EXT_API extern void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
LIBGTKMM2EXT_API extern std::string get_key_representation (const std::string& accel_path, Gtk::AccelKey& key);
diff --git a/libs/gtkmm2ext/gtkmm2ext/auto_spin.h b/libs/gtkmm2ext/gtkmm2ext/auto_spin.h
index 70aedbe50e..da19a1a1f7 100644
--- a/libs/gtkmm2ext/gtkmm2ext/auto_spin.h
+++ b/libs/gtkmm2ext/gtkmm2ext/auto_spin.h
@@ -74,5 +74,5 @@ class LIBGTKMM2EXT_API AutoSpin
};
} /* namespace */
-
+
#endif /* __gtkmm2ext_auto_spin_h__ */
diff --git a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h
index ce10411a2c..f529c5c557 100644
--- a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h
+++ b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h
@@ -80,4 +80,4 @@ class LIBGTKMM2EXT_API BarController : public Gtk::Alignment
}; /* namespace */
-#endif // __gtkmm2ext_bar_controller_h__
+#endif // __gtkmm2ext_bar_controller_h__
diff --git a/libs/gtkmm2ext/gtkmm2ext/bindable_button.h b/libs/gtkmm2ext/gtkmm2ext/bindable_button.h
index cf74d3aca0..d96f8145a4 100644
--- a/libs/gtkmm2ext/gtkmm2ext/bindable_button.h
+++ b/libs/gtkmm2ext/gtkmm2ext/bindable_button.h
@@ -40,7 +40,7 @@ class LIBGTKMM2EXT_API BindableToggleButton : public Gtkmm2ext::StatefulToggleBu
BindableToggleButton () {}
virtual ~BindableToggleButton() {}
-
+
bool on_button_press_event (GdkEventButton *ev) {
if (!binding_proxy.button_press_handler (ev)) {
StatefulToggleButton::on_button_press_event (ev);
@@ -49,7 +49,7 @@ class LIBGTKMM2EXT_API BindableToggleButton : public Gtkmm2ext::StatefulToggleBu
return true;
}
}
-
+
boost::shared_ptr<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); }
void set_controllable (boost::shared_ptr<PBD::Controllable> c);
void watch ();
@@ -67,7 +67,7 @@ class LIBGTKMM2EXT_API BindableButton : public Gtkmm2ext::StatefulButton
public:
BindableButton (boost::shared_ptr<PBD::Controllable> c) : binding_proxy (c) {}
~BindableButton() {}
-
+
bool on_button_press_event (GdkEventButton *ev) {
if (!binding_proxy.button_press_handler (ev)) {
StatefulButton::on_button_press_event (ev);
diff --git a/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h b/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h
index 022a0cbcd9..7108c46eb2 100644
--- a/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h
+++ b/libs/gtkmm2ext/gtkmm2ext/binding_proxy.h
@@ -39,7 +39,7 @@ class LIBGTKMM2EXT_API BindingProxy : public sigc::trackable
BindingProxy (boost::shared_ptr<PBD::Controllable>);
BindingProxy ();
virtual ~BindingProxy();
-
+
void set_bind_button_state (guint button, guint statemask);
static bool is_bind_action (GdkEventButton *);
@@ -51,10 +51,10 @@ class LIBGTKMM2EXT_API BindingProxy : public sigc::trackable
protected:
Gtkmm2ext::PopUp* prompter;
boost::shared_ptr<PBD::Controllable> controllable;
-
+
static guint bind_button;
static guint bind_statemask;
-
+
PBD::ScopedConnection learning_connection;
void learning_finished ();
bool prompter_hiding (GdkEventAny *);
diff --git a/libs/gtkmm2ext/gtkmm2ext/cairo_widget.h b/libs/gtkmm2ext/gtkmm2ext/cairo_widget.h
index 436dc0382d..b6b4ccd83e 100644
--- a/libs/gtkmm2ext/gtkmm2ext/cairo_widget.h
+++ b/libs/gtkmm2ext/gtkmm2ext/cairo_widget.h
@@ -39,11 +39,11 @@ public:
Gtkmm2ext::ActiveState active_state() const { return _active_state; }
Gtkmm2ext::VisualState visual_state() const { return _visual_state; }
-
+
/* derived widgets can override these two to catch
changes in active & visual state
*/
-
+
virtual void set_active_state (Gtkmm2ext::ActiveState);
virtual void set_visual_state (Gtkmm2ext::VisualState);
@@ -80,7 +80,7 @@ public:
/* set_focus_handler() will cause all button-press events on any
CairoWidget to invoke this slot/functor/function/method/callback.
-
+
We do this because in general, CairoWidgets do not grab
keyboard focus, but a button press on them should
clear focus from any active text entry.
@@ -103,7 +103,7 @@ protected:
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
bool on_button_press_event (GdkEventButton*);
Gdk::Color get_parent_bg ();
-
+
/* this is an additional virtual "on_..." method. Glibmm does not
provide a direct signal for name changes, so this acts as a proxy.
*/
@@ -125,7 +125,7 @@ protected:
Glib::SignalProxyProperty _name_proxy;
sigc::connection _parent_style_change;
Widget * _current_parent;
-
+
};
#endif
diff --git a/libs/gtkmm2ext/gtkmm2ext/cairocell.h b/libs/gtkmm2ext/gtkmm2ext/cairocell.h
index a061672fb8..8fe166624f 100644
--- a/libs/gtkmm2ext/gtkmm2ext/cairocell.h
+++ b/libs/gtkmm2ext/gtkmm2ext/cairocell.h
@@ -36,7 +36,7 @@ class LIBGTKMM2EXT_API CairoCell
public:
CairoCell(int32_t id);
virtual ~CairoCell() {}
-
+
int32_t id() const { return _id; }
virtual void render (Cairo::RefPtr<Cairo::Context>&) = 0;
@@ -165,7 +165,7 @@ public:
void set_width_chars (CairoTextCell* cell, uint32_t);
void set_draw_background (bool yn) { _draw_bg = yn; }
-
+
void set_colors (double cr, double cg, double cb, double ca) {
r = cr;
g = cg;
@@ -194,7 +194,7 @@ public:
void set_xpad (double x) { _xpad = x; queue_resize(); }
double ypad() const { return _ypad; }
void set_ypad (double y) { _ypad = y; queue_resize(); }
-
+
double corner_radius() const { return _corner_radius; }
void set_corner_radius (double r) { _corner_radius = r; queue_draw (); }
diff --git a/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_multi.h b/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_multi.h
index e84a635fa0..c921976dd3 100644
--- a/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_multi.h
+++ b/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_multi.h
@@ -53,7 +53,7 @@ class LIBGTKMM2EXT_API CellRendererPixbufMulti : public Gtk::CellRenderer
Glib::PropertyProxy<uint32_t> property_state();
void set_pixbuf(uint32_t state, Glib::RefPtr<Gdk::Pixbuf> pixbuf);
-
+
typedef sigc::signal<void, const Glib::ustring&> SignalChanged;
SignalChanged& signal_changed();
diff --git a/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_toggle.h b/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_toggle.h
index 30171dd692..3fd2d65aa9 100644
--- a/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_toggle.h
+++ b/libs/gtkmm2ext/gtkmm2ext/cell_renderer_pixbuf_toggle.h
@@ -62,7 +62,7 @@ class LIBGTKMM2EXT_API CellRendererPixbufToggle : public Gtk::CellRenderer
private:
Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf_;
Glib::Property<bool> property_active_;
-
+
Glib::RefPtr<Gdk::Pixbuf> active_pixbuf;
Glib::RefPtr<Gdk::Pixbuf> inactive_pixbuf;
diff --git a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h
index dd58f77a4c..083fee6378 100644
--- a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h
+++ b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h
@@ -52,7 +52,7 @@ class LIBGTKMM2EXT_API DnDTreeViewBase : public Gtk::TreeView
Gtk::TreeView::on_drag_begin (context);
start_object_drag ();
}
-
+
void on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time) {
suggested_action = context->get_suggested_action();
TreeView::on_drag_leave (context, time);
@@ -73,12 +73,12 @@ class LIBGTKMM2EXT_API DnDTreeViewBase : public Gtk::TreeView
struct DragData {
DragData () : source (0) {}
-
+
Gtk::TreeView* source;
int data_column;
std::string object_type;
};
-
+
static DragData drag_data;
void start_object_drag () {
@@ -112,7 +112,7 @@ class /*LIBGTKMM2EXT_API*/ DnDTreeView : public DnDTreeViewBase
selection_data.set (8, (guchar*)&c, 1);
}
}
-
+
void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time) {
if (suggested_action) {
/* this is a drag motion callback. just update the status to
@@ -122,14 +122,14 @@ class /*LIBGTKMM2EXT_API*/ DnDTreeView : public DnDTreeViewBase
TreeView::on_drag_data_received (context, x, y, selection_data, info, time);
return;
}
-
+
if (selection_data.get_target() == "GTK_TREE_MODEL_ROW") {
-
+
TreeView::on_drag_data_received (context, x, y, selection_data, info, time);
-
+
} else if (selection_data.get_target() == object_type) {
-
+
end_object_drag (const_cast<Glib::RefPtr<Gdk::DragContext>& > (context), x, y);
} else {
@@ -147,16 +147,16 @@ class /*LIBGTKMM2EXT_API*/ DnDTreeView : public DnDTreeViewBase
if (drag_data.source == 0) {
return;
}
-
+
Glib::RefPtr<Gtk::TreeModel> model = drag_data.source->get_model();
DataType v;
Gtk::TreeSelection::ListHandle_Path selection = drag_data.source->get_selection()->get_selected_rows ();
-
+
for (Gtk::TreeSelection::ListHandle_Path::iterator x = selection.begin(); x != selection.end(); ++x) {
model->get_iter (*x)->get_value (drag_data.data_column, v);
l.push_back (v);
}
-
+
*source = drag_data.source;
}
diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h
index 940a72859e..84289aff34 100644
--- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h
+++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h
@@ -24,15 +24,15 @@
namespace Gtkmm2ext {
-/** Parent class for children of a DnDVBox */
+/** Parent class for children of a DnDVBox */
class /*LIBGTKMM2EXT_API*/ DnDVBoxChild
{
public:
virtual ~DnDVBoxChild () {}
-
+
/** @return The widget that is to be put into the DnDVBox */
virtual Gtk::Widget& widget () = 0;
-
+
/** @return An EventBox containing the widget that should be used for selection, dragging etc. */
virtual Gtk::EventBox& action_widget () = 0;
@@ -68,15 +68,15 @@ public:
signal_drag_leave().connect (mem_fun (*this, &DnDVBox::drag_leave));
_internal_vbox.show ();
-
+
drag_dest_set (_targets);
signal_drag_data_received().connect (mem_fun (*this, &DnDVBox::drag_data_received));
}
-
+
virtual ~DnDVBox ()
{
clear ();
-
+
delete _drag_icon;
}
@@ -89,9 +89,9 @@ public:
child->action_widget().signal_drag_end().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_end), child));
child->action_widget().signal_button_press_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_press), child));
child->action_widget().signal_button_release_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_release), child));
-
+
_internal_vbox.pack_start (child->widget(), false, false);
-
+
_children.push_back (child);
child->widget().show ();
}
@@ -180,7 +180,7 @@ public:
T* after;
std::pair<T*, double> r;
-
+
r.second = get_children_around_position (y, &before, &r.first, &after);
return r;
@@ -206,7 +206,7 @@ public:
{
return create_or_update_placeholder (get_child_at_position (y).second);
}
-
+
/** Children have been reordered by a drag */
sigc::signal<void> Reordered;
@@ -241,7 +241,7 @@ private:
return bottom;
}
-
+
/** Look at a y coordinate and find the children below y, and the ones either side.
* @param y y position.
* @param before Filled in with the child before, or 0.
@@ -270,7 +270,7 @@ private:
while (y >= bottom && j != _children.end()) {
top = bottom;
-
+
*before = *j;
++i;
++j;
@@ -297,13 +297,13 @@ private:
void drag_begin (Glib::RefPtr<Gdk::DragContext> const & context, T* child)
{
_drag_child = child;
-
+
/* make up an icon for the drag */
_drag_icon = new Gtk::Window (Gtk::WINDOW_POPUP);
-
+
Gtk::Allocation a = child->action_widget().get_allocation ();
_drag_icon->set_size_request (a.get_width(), a.get_height());
-
+
_drag_icon->signal_expose_event().connect (sigc::mem_fun (*this, &DnDVBox::icon_expose));
_drag_icon->set_name (get_name ());
@@ -317,7 +317,7 @@ private:
int w, h;
_drag_icon->get_size (w, h);
_drag_icon->drag_set_as_icon (context, w / 2, h / 2);
-
+
_drag_source = this;
}
@@ -336,22 +336,22 @@ private:
cairo_rectangle (cr, 0, 0, w, h);
cairo_fill (cr);
cairo_destroy (cr);
-
+
return false;
}
-
+
void drag_data_get (Glib::RefPtr<Gdk::DragContext> const &, Gtk::SelectionData & selection_data, guint, guint, T* child)
{
selection_data.set (selection_data.get_target(), 8, (const guchar *) &child, sizeof (&child));
}
-
+
void drag_data_received (
Glib::RefPtr<Gdk::DragContext> const & context, int /*x*/, int y, Gtk::SelectionData const & selection_data, guint /*info*/, guint time
)
{
/* work out where it was dropped */
std::pair<T*, double> const drop = get_child_at_position (y);
-
+
if (_drag_source == this) {
/* dropped from ourselves onto ourselves */
@@ -364,7 +364,7 @@ private:
/* where in the list this child should be dropped */
int target = drop.second + 0.5;
-
+
/* find out whether the child was `picked up' from before the drop position */
int n = 0;
typename std::list<T*>::const_iterator i = _children.begin ();
@@ -372,31 +372,31 @@ private:
++i;
++n;
}
-
+
/* if so, adjust the drop position to account for this */
if (n < target) {
--target;
}
-
+
_internal_vbox.reorder_child (child->widget(), target);
}
-
+
} else {
-
+
/* drag started in another DnDVBox; raise a signal to say what happened */
-
+
std::list<T*> dropped = _drag_source->selection ();
DropFromAnotherBox (_drag_source, drop.first, context);
}
-
+
context->drag_finish (false, false, time);
}
-
+
void drag_end (Glib::RefPtr<Gdk::DragContext> const &, T *)
{
delete _drag_icon;
_drag_icon = 0;
-
+
_drag_child = 0;
remove_placeholder ();
@@ -474,7 +474,7 @@ private:
if (child) {
_expecting_unwanted_button_event = true;
}
-
+
if (ev->button == 1 || ev->button == 3) {
if (!selected (child)) {
@@ -492,7 +492,7 @@ private:
if (selecting && !was_selected) {
add_to_selection (*i);
}
-
+
if (!selecting && !done) {
if (selected (*i)) {
selecting = true;
@@ -509,19 +509,19 @@ private:
}
} else {
-
+
if ((ev->state & Gdk::CONTROL_MASK) == 0) {
clear_selection ();
}
-
+
if (child) {
add_to_selection (child);
}
}
-
+
SelectionChanged (); /* EMIT SIGNAL */
-
+
} else {
/* XXX THIS NEEDS GENERALIZING FOR OS X */
if (ev->button == 1 && (ev->state & Gdk::CONTROL_MASK)) {
@@ -535,7 +535,7 @@ private:
return ButtonPress (ev, child); /* EMIT SIGNAL */
}
-
+
bool button_release (GdkEventButton* ev, T* child)
{
if (_expecting_unwanted_button_event == true && child == 0) {
@@ -565,7 +565,7 @@ private:
setup_child_state (*i);
}
}
-
+
void add_to_selection (T* child)
{
if ( !child->is_selectable() )
@@ -583,21 +583,21 @@ private:
setup_child_state (c);
}
}
-
+
T* child_from_widget (Gtk::Widget const * w) const
{
typename std::list<T*>::const_iterator i = _children.begin();
while (i != _children.end() && &(*i)->widget() != w) {
++i;
}
-
+
if (i == _children.end()) {
return 0;
}
return *i;
}
-
+
Gtk::VBox _internal_vbox;
std::list<Gtk::TargetEntry> _targets;
std::list<T*> _children;
@@ -611,12 +611,12 @@ private:
Gtk::Label* _placeholder;
/** Our child being dragged, or 0 */
T* _drag_child;
-
+
static DnDVBox* _drag_source;
-
+
};
template <class T>
DnDVBox<T>* DnDVBox<T>::_drag_source = 0;
-
+
}
diff --git a/libs/gtkmm2ext/gtkmm2ext/focus_entry.h b/libs/gtkmm2ext/gtkmm2ext/focus_entry.h
index cc0c2ef73a..2dce03cb2b 100644
--- a/libs/gtkmm2ext/gtkmm2ext/focus_entry.h
+++ b/libs/gtkmm2ext/gtkmm2ext/focus_entry.h
@@ -30,7 +30,7 @@ class LIBGTKMM2EXT_API FocusEntry : public Gtk::Entry
{
public:
FocusEntry ();
-
+
protected:
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
diff --git a/libs/gtkmm2ext/gtkmm2ext/grouped_buttons.h b/libs/gtkmm2ext/gtkmm2ext/grouped_buttons.h
index 06e7fffe83..15b01bff4f 100644
--- a/libs/gtkmm2ext/gtkmm2ext/grouped_buttons.h
+++ b/libs/gtkmm2ext/gtkmm2ext/grouped_buttons.h
@@ -36,7 +36,7 @@ class LIBGTKMM2EXT_API GroupedButtons : public sigc::trackable
public:
GroupedButtons (uint32_t nbuttons, uint32_t first_active);
GroupedButtons (std::vector<Gtk::ToggleButton *>&);
-
+
Gtk::ToggleButton& button (uint32_t which) {
return *buttons[which];
}
diff --git a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
index cc0d67b2ec..868f71fd8d 100644
--- a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
+++ b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h
@@ -167,7 +167,7 @@ class LIBGTKMM2EXT_API UI : public AbstractUI<UIRequest>
sigc::signal<void> theme_changed;
static bool just_hide_it (GdkEventAny *, Gtk::Window *);
-
+
protected:
virtual void handle_fatal (const char *);
virtual void display_message (const char *prefix, gint prefix_len,
diff --git a/libs/gtkmm2ext/gtkmm2ext/keyboard.h b/libs/gtkmm2ext/gtkmm2ext/keyboard.h
index 73c9ad7d42..fca5d9f817 100644
--- a/libs/gtkmm2ext/gtkmm2ext/keyboard.h
+++ b/libs/gtkmm2ext/gtkmm2ext/keyboard.h
@@ -145,7 +145,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static void set_insert_note_button (guint);
static guint insert_note_modifier() { return insert_note_mod; }
static void set_insert_note_modifier(guint);
-
+
static bool is_edit_event (GdkEventButton*);
static bool is_delete_event (GdkEventButton*);
static bool is_insert_note_event (GdkEventButton*);
diff --git a/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h b/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h
index ee3ba167a5..91e7a67a7e 100644
--- a/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h
+++ b/libs/gtkmm2ext/gtkmm2ext/motionfeedback.h
@@ -103,7 +103,7 @@ class LIBGTKMM2EXT_API MotionFeedback : public Gtk::VBox
to a display value (0.0 .. 1.0)
*/
virtual double to_display_value (double) = 0;
-
+
virtual double adjust (double nominal_delta) = 0;
private:
@@ -130,5 +130,5 @@ class LIBGTKMM2EXT_API MotionFeedback : public Gtk::VBox
};
} /* namespace */
-
+
#endif // __gtkmm2ext_motion_feedback_h__
diff --git a/libs/gtkmm2ext/gtkmm2ext/persistent_tooltip.h b/libs/gtkmm2ext/gtkmm2ext/persistent_tooltip.h
index 0ad9439fa8..9883fd2020 100644
--- a/libs/gtkmm2ext/gtkmm2ext/persistent_tooltip.h
+++ b/libs/gtkmm2ext/gtkmm2ext/persistent_tooltip.h
@@ -34,7 +34,7 @@ class LIBGTKMM2EXT_API PersistentTooltip : public sigc::trackable
public:
PersistentTooltip (Gtk::Widget *, bool draggable = false, int margin_y = 0);
virtual ~PersistentTooltip ();
-
+
void set_tip (std::string);
void set_font (Pango::FontDescription font);
void set_center_alignment (bool align_to_center);
diff --git a/libs/gtkmm2ext/gtkmm2ext/pixscroller.h b/libs/gtkmm2ext/gtkmm2ext/pixscroller.h
index 50586a9028..0a0d2593c7 100644
--- a/libs/gtkmm2ext/gtkmm2ext/pixscroller.h
+++ b/libs/gtkmm2ext/gtkmm2ext/pixscroller.h
@@ -60,7 +60,7 @@ class LIBGTKMM2EXT_API PixScroller : public Gtk::DrawingArea
double grab_start;
int overall_height;
bool dragging;
-
+
float default_value;
void adjustment_changed ();
diff --git a/libs/gtkmm2ext/gtkmm2ext/scroomer.h b/libs/gtkmm2ext/gtkmm2ext/scroomer.h
index 5d9ca69801..4d957b4868 100644
--- a/libs/gtkmm2ext/gtkmm2ext/scroomer.h
+++ b/libs/gtkmm2ext/gtkmm2ext/scroomer.h
@@ -56,7 +56,7 @@ public:
void set_min_page_size(double page_size);
int get_handle_size() { return handle_size; }
-
+
inline int position_of(Component comp) { return position[comp]; }
sigc::signal0<void> DragStarting;
diff --git a/libs/gtkmm2ext/gtkmm2ext/slider_controller.h b/libs/gtkmm2ext/gtkmm2ext/slider_controller.h
index 460f4a88ae..e756180eaf 100644
--- a/libs/gtkmm2ext/gtkmm2ext/slider_controller.h
+++ b/libs/gtkmm2ext/gtkmm2ext/slider_controller.h
@@ -81,4 +81,4 @@ class LIBGTKMM2EXT_API HSliderController : public SliderController
}; /* namespace */
-#endif // __gtkmm2ext_slider_controller_h__
+#endif // __gtkmm2ext_slider_controller_h__
diff --git a/libs/gtkmm2ext/gtkmm2ext/textviewer.h b/libs/gtkmm2ext/gtkmm2ext/textviewer.h
index 98d13a2a7d..51af88c005 100644
--- a/libs/gtkmm2ext/gtkmm2ext/textviewer.h
+++ b/libs/gtkmm2ext/gtkmm2ext/textviewer.h
@@ -48,7 +48,7 @@ class LIBGTKMM2EXT_API TextViewer : public Gtk::Window, public Transmitter
void insert_file (const std::string &);
void scroll_to_bottom ();
-
+
void deliver ();
};
diff --git a/libs/gtkmm2ext/gtkmm2ext/utils.h b/libs/gtkmm2ext/gtkmm2ext/utils.h
index 0182fec456..62ffba3b9c 100644
--- a/libs/gtkmm2ext/gtkmm2ext/utils.h
+++ b/libs/gtkmm2ext/gtkmm2ext/utils.h
@@ -58,16 +58,16 @@ namespace Gtkmm2ext {
LIBGTKMM2EXT_API void get_ink_pixel_size (Glib::RefPtr<Pango::Layout>,
int& width, int& height);
-
+
LIBGTKMM2EXT_API void get_pixel_size (Glib::RefPtr<Pango::Layout>,
int& width, int& height);
-
+
LIBGTKMM2EXT_API void set_size_request_to_display_given_text (Gtk::Widget &w,
const gchar *text,
gint hpadding,
gint vpadding);
-
+
LIBGTKMM2EXT_API void set_size_request_to_display_given_text_width (Gtk::Widget& w,
const gchar* htext,
gint hpadding,
@@ -108,7 +108,7 @@ namespace Gtkmm2ext {
LIBGTKMM2EXT_API bool set_active_text_if_present (Gtk::ComboBoxText&,
const std::string);
-
+
template<class T> /*LIBGTKMM2EXT_API*/ void deferred_delete (void *ptr) {
delete static_cast<T *> (ptr);
}
@@ -131,7 +131,7 @@ namespace Gtkmm2ext {
LIBGTKMM2EXT_API void container_clear (Gtk::Container&);
/* C++ API for rounded rectangles */
-
+
LIBGTKMM2EXT_API void rounded_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_top_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_top_left_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
diff --git a/libs/gtkmm2ext/gtkmm2ext/widget_state.h b/libs/gtkmm2ext/gtkmm2ext/widget_state.h
index 3e873f303b..bb8bd375f0 100644
--- a/libs/gtkmm2ext/gtkmm2ext/widget_state.h
+++ b/libs/gtkmm2ext/gtkmm2ext/widget_state.h
@@ -14,7 +14,7 @@ namespace Gtkmm2ext {
ExplicitActive,
ImplicitActive,
};
-
+
enum LIBGTKMM2EXT_API VisualState {
/* these can be OR-ed together */
NoVisualState = 0x0,
diff --git a/libs/gtkmm2ext/idle_adjustment.cc b/libs/gtkmm2ext/idle_adjustment.cc
index 37bb28c1a2..6f5fd13294 100644
--- a/libs/gtkmm2ext/idle_adjustment.cc
+++ b/libs/gtkmm2ext/idle_adjustment.cc
@@ -44,14 +44,14 @@ void
IdleAdjustment::underlying_adjustment_value_changed ()
{
last_vc = g_get_monotonic_time();
-
+
if (timeout_queued) {
return;
}
Glib::signal_timeout().connect(mem_fun(*this, &IdleAdjustment::timeout_handler), 250);
timeout_queued = true;
-}
+}
gint
IdleAdjustment::timeout_handler ()
diff --git a/libs/gtkmm2ext/keyboard.cc b/libs/gtkmm2ext/keyboard.cc
index b0d952a11a..b08a1e4f8c 100644
--- a/libs/gtkmm2ext/keyboard.cc
+++ b/libs/gtkmm2ext/keyboard.cc
@@ -644,7 +644,7 @@ Keyboard::reset_bindings ()
string new_path = user_keybindings_path;
new_path += ".old";
-
+
if (::g_rename (user_keybindings_path.c_str(), new_path.c_str())) {
error << string_compose (_("Cannot rename your own keybinding file (%1)"), strerror (errno)) << endmsg;
return -1;
diff --git a/libs/gtkmm2ext/motionfeedback.cc b/libs/gtkmm2ext/motionfeedback.cc
index 458aeeff3b..08436ac6bf 100644
--- a/libs/gtkmm2ext/motionfeedback.cc
+++ b/libs/gtkmm2ext/motionfeedback.cc
@@ -96,7 +96,7 @@ MotionFeedback::MotionFeedback (Glib::RefPtr<Gdk::Pixbuf> pix,
value = new Label;
value->set_justify (Gtk::JUSTIFY_RIGHT);
value->show ();
-
+
value_packer->add (*value);
hpacker = manage (new HBox);
@@ -198,7 +198,7 @@ MotionFeedback::pixwin_button_release_event (GdkEventButton *ev)
_controllable->set_value (_controllable->lower ());
}
break;
-
+
case 3:
if (pixwin.has_grab()) {
if (grab_is_fine) {
@@ -329,7 +329,7 @@ MotionFeedback::pixwin_key_press_event (GdkEventKey *ev)
_controllable->set_value (_controllable->upper());
break;
}
-
+
return retval;
}
@@ -343,7 +343,7 @@ MotionFeedback::pixwin_expose_event (GdkEventExpose*)
GdkWindow *window = pixwin.get_window()->gobj();
double display_val = to_display_value (_controllable->get_value());
int32_t phase = lrint (display_val * 64.0);
-
+
// skip middle phase except for true middle value
if (type == Rotary && phase == 32) {
@@ -496,30 +496,30 @@ MotionFeedback::render_pixbuf (int size)
GdkColor dark;
GdkColor bright;
ProlooksHSV* hsv;
-
+
hsv = prolooks_hsv_new_for_gdk_color (base_color->gobj());
bright = (prolooks_hsv_to_gdk_color (hsv, &col2), col2);
prolooks_hsv_set_saturation (hsv, 0.66);
prolooks_hsv_set_value (hsv, 0.67);
dark = (prolooks_hsv_to_gdk_color (hsv, &col3), col3);
-
+
cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, size * 64, size);
cairo_t* cr = cairo_create (surface);
-
+
for (int i = 0; i < 64; ++i) {
cairo_save (cr);
core_draw (cr, i, size, 20, size*i, 0, &bright, &dark);
cairo_restore (cr);
}
-
+
if (cairo_surface_write_to_png (surface, path) != CAIRO_STATUS_SUCCESS) {
error << string_compose (_("motionfeedback: could not save image set to %1"), path) << endmsg;
return pixbuf;
}
-
+
cairo_destroy (cr);
cairo_surface_destroy (surface);
-
+
try {
pixbuf = Gdk::Pixbuf::create_from_file (path);
} catch (const Gdk::PixbufError &e) {
@@ -530,7 +530,7 @@ MotionFeedback::render_pixbuf (int size)
g_unlink (path);
g_free (path);
-
+
return pixbuf;
}
@@ -593,7 +593,7 @@ MotionFeedback::core_draw (cairo_t* cr, int phase, double size, double progress_
cairo_arc (cr, xc, yc, progress_radius, start_angle, end_angle);
cairo_stroke (cr);
-
+
float r = (value) * (((float)bright->red)/G_MAXUINT16) + (1.0-value)*(((float)dark->red)/G_MAXUINT16);
float g = (value) * (((float)bright->green)/G_MAXUINT16) + (1.0-value)*(((float)dark->green)/G_MAXUINT16);
float b = (value) * (((float)bright->blue)/G_MAXUINT16) + (1.0-value)*(((float)dark->blue)/G_MAXUINT16);
@@ -612,7 +612,7 @@ MotionFeedback::core_draw (cairo_t* cr, int phase, double size, double progress_
cairo_arc (cr, xc, yc, progress_radius_outer-1, 0, 2.0*G_PI);
cairo_fill (cr);
cairo_pattern_destroy (shade_pattern);
-
+
//black border
cairo_set_source_rgb (cr, 0, 0, 0 );
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
@@ -640,7 +640,7 @@ MotionFeedback::core_draw (cairo_t* cr, int phase, double size, double progress_
cairo_set_source_rgba (cr, 0.3, 0.3, 0.3, 1 );
cairo_arc (cr, xc, yc, progress_radius_inner-1, 0, 2.0*G_PI);
cairo_fill (cr);
-
+
//knob shade
shade_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, progress_radius_outer);
cairo_pattern_add_color_stop_rgba (shade_pattern, 0, 1,1,1, 0.5);
@@ -649,7 +649,7 @@ MotionFeedback::core_draw (cairo_t* cr, int phase, double size, double progress_
cairo_arc (cr, xc, yc, progress_radius_inner-1, 0, 2.0*G_PI);
cairo_fill (cr);
cairo_pattern_destroy (shade_pattern);
-
+
//inner circle
cairo_set_source_rgba (cr, 0.3, 0.3, 0.3, 0.5 );
cairo_arc (cr, xc, yc, progress_radius_inner-5, 0, 2.0*G_PI);
diff --git a/libs/gtkmm2ext/persistent_tooltip.cc b/libs/gtkmm2ext/persistent_tooltip.cc
index 88be6ef100..c7cb3f4df2 100644
--- a/libs/gtkmm2ext/persistent_tooltip.cc
+++ b/libs/gtkmm2ext/persistent_tooltip.cc
@@ -138,7 +138,7 @@ PersistentTooltip::show ()
_window->set_transient_for (*tlw);
}
}
-
+
set_tip (_tip);
if (!_window->is_visible ()) {
@@ -146,7 +146,7 @@ PersistentTooltip::show ()
int sw = gdk_screen_width ();
_target->get_window()->get_origin (rx, ry);
-
+
/* the window needs to be realized first
* for _window->get_width() to be correct.
*/
diff --git a/libs/gtkmm2ext/pixscroller.cc b/libs/gtkmm2ext/pixscroller.cc
index 570d04c1c3..55bbef8c80 100644
--- a/libs/gtkmm2ext/pixscroller.cc
+++ b/libs/gtkmm2ext/pixscroller.cc
@@ -104,7 +104,7 @@ PixScroller::on_expose_event (GdkEventExpose* ev)
context->paint();
context->restore();
}
-
+
if (gdk_rectangle_intersect (sliderrect.gobj(), &ev->area, &intersect)) {
context->save();
@@ -136,7 +136,7 @@ PixScroller::on_button_press_event (GdkEventButton* ev)
default:
break;
}
-
+
return false;
}
@@ -145,7 +145,7 @@ bool
PixScroller::on_button_release_event (GdkEventButton* ev)
{
double scale;
-
+
if (ev->state & Keyboard::PrimaryModifier) {
if (ev->state & Keyboard::SecondaryModifier) {
scale = 0.05;
@@ -195,7 +195,7 @@ bool
PixScroller::on_scroll_event (GdkEventScroll* ev)
{
double scale;
-
+
if (ev->state & Keyboard::PrimaryModifier) {
if (ev->state & Keyboard::SecondaryModifier) {
scale = 0.05;
@@ -235,7 +235,7 @@ PixScroller::on_motion_notify_event (GdkEventMotion* ev)
grab_window = ev->window;
return true;
}
-
+
if (ev->state & Keyboard::PrimaryModifier) {
if (ev->state & Keyboard::SecondaryModifier) {
scale = 0.05;
@@ -253,7 +253,7 @@ PixScroller::on_motion_notify_event (GdkEventMotion* ev)
fract = min (1.0, fract);
fract = max (-1.0, fract);
-
+
fract = -fract;
adj.set_value (adj.get_value() + scale * fract * (adj.get_upper() - adj.get_lower()));
diff --git a/libs/gtkmm2ext/popup.cc b/libs/gtkmm2ext/popup.cc
index 028490f11e..898211c986 100644
--- a/libs/gtkmm2ext/popup.cc
+++ b/libs/gtkmm2ext/popup.cc
@@ -101,7 +101,7 @@ PopUp::touch ()
set_size_request_to_display_given_text (label, my_text.c_str(), 25, 10);
label.set_text (my_text);
show_all ();
-
+
if (popdown_time != 0) {
timeout = g_timeout_add (popdown_time,
remove_prompt_timeout,
@@ -137,7 +137,7 @@ PopUp::on_delete_event (GdkEventAny* /*ev*/)
if (popdown_time != 0 && timeout != -1) {
g_source_remove (timeout);
- }
+ }
if (delete_on_hide) {
std::cerr << "deleting prompter\n" << endl;
diff --git a/libs/gtkmm2ext/prompter.cc b/libs/gtkmm2ext/prompter.cc
index 03cfb25be4..1f5e13b923 100644
--- a/libs/gtkmm2ext/prompter.cc
+++ b/libs/gtkmm2ext/prompter.cc
@@ -52,7 +52,7 @@ Prompter::init ()
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
set_position (Gtk::WIN_POS_MOUSE);
set_name ("Prompter");
-
+
add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
/*
@@ -62,7 +62,7 @@ Prompter::init ()
set_response_sensitive (Gtk::RESPONSE_ACCEPT, false)
to prevent the RESPONSE_ACCEPT button from permitting blank strings.
*/
-
+
entryLabel.set_line_wrap (true);
entryLabel.set_name ("PrompterLabel");
@@ -74,7 +74,7 @@ Prompter::init ()
get_vbox()->pack_start (entryBox);
show_all_children();
-}
+}
void
Prompter::on_show ()
@@ -117,7 +117,7 @@ Prompter::entry_activated ()
} else {
response (Gtk::RESPONSE_CANCEL);
}
-}
+}
void
Prompter::on_entry_changed ()
diff --git a/libs/gtkmm2ext/scroomer.cc b/libs/gtkmm2ext/scroomer.cc
index 9b56706d21..69944b4bc7 100644
--- a/libs/gtkmm2ext/scroomer.cc
+++ b/libs/gtkmm2ext/scroomer.cc
@@ -111,29 +111,29 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
unzoomed_page += scale * fract * range;
unzoomed_page = min(unzoomed_page, adj.get_upper() - unzoomed_val);
unzoomed_page = max(unzoomed_page, min_page_size);
-
+
if (pinch){
temp = unzoomed_val + unzoomed_page;
unzoomed_val -= scale * fract * range * 0.5;
unzoomed_val = min(unzoomed_val, temp - min_page_size);
unzoomed_val = max(unzoomed_val, adj.get_lower());
}
-
+
break;
case Handle2:
temp = unzoomed_val + unzoomed_page;
unzoomed_val += scale * fract * range;
unzoomed_val = min(unzoomed_val, temp - min_page_size);
unzoomed_val = max(unzoomed_val, adj.get_lower());
-
+
unzoomed_page = temp - unzoomed_val;
-
+
if (pinch){
-
+
unzoomed_page -= scale * fract * range;
}
-
- unzoomed_page = min(unzoomed_page, adj.get_upper() - unzoomed_val);
+
+ unzoomed_page = min(unzoomed_page, adj.get_upper() - unzoomed_val);
unzoomed_page = max(unzoomed_page, min_page_size);
break;
default:
@@ -145,10 +145,10 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
* We don't start doing zoom until we are at least one scroomer width outside the scroomer's
* area.
*/
-
+
if (ev->x > (get_width() * 2)) {
zoom = ev->x - get_width();
-
+
double higher = unzoomed_val + unzoomed_page - half_min_page - val_at_pointer;
double lower = val_at_pointer - (unzoomed_val + half_min_page);
@@ -204,7 +204,7 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
adj.set_page_size (rint (page));
adj.set_value (rint (val));
adj.value_changed();
-
+
return true;
}
@@ -241,7 +241,7 @@ Scroomer::on_button_press_event (GdkEventButton* ev)
unzoomed_val = adj.get_value();
unzoomed_page = adj.get_page_size();
grab_window = ev->window;
-
+
if (ev->button == 3){
pinch = true;
} else {
@@ -250,7 +250,7 @@ Scroomer::on_button_press_event (GdkEventButton* ev)
DragStarting (); /* EMIT SIGNAL */
}
-
+
if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) {
DoubleClicked();
}
@@ -289,7 +289,7 @@ Scroomer::on_button_release_event (GdkEventButton* ev)
default:
break;
}
-
+
grab_comp = None;
remove_modal_grab();
diff --git a/libs/gtkmm2ext/selector.cc b/libs/gtkmm2ext/selector.cc
index 55499967d1..04fbd13001 100644
--- a/libs/gtkmm2ext/selector.cc
+++ b/libs/gtkmm2ext/selector.cc
@@ -157,7 +157,7 @@ Selector::chosen ()
{
Glib::RefPtr<Gtk::TreeSelection> tree_sel = tview.get_selection();
Gtk::TreeModel::iterator iter = tree_sel->get_selected();
-
+
if (iter) {
choice_made (new Result (tview, tree_sel));
} else {
diff --git a/libs/gtkmm2ext/sync-menu.c b/libs/gtkmm2ext/sync-menu.c
index c37fb6c3c4..14933e5119 100644
--- a/libs/gtkmm2ext/sync-menu.c
+++ b/libs/gtkmm2ext/sync-menu.c
@@ -340,7 +340,7 @@ carbon_menu_item_update_accelerator (CarbonMenuItem *carbon_item,
default:
break;
}
-
+
if (realkey != -1) {
SetMenuItemCommandKey (carbon_item->menu, carbon_item->index,
false, realkey);
@@ -381,7 +381,7 @@ carbon_menu_item_update_accelerator (CarbonMenuItem *carbon_item,
}
/* gdk/quartz maps Command to Meta */
-
+
if (key->accel_mods & GDK_META_MASK) {
use_command = 1;
}
diff --git a/libs/gtkmm2ext/tearoff.cc b/libs/gtkmm2ext/tearoff.cc
index 9890f80ceb..dbe5c3dc5c 100644
--- a/libs/gtkmm2ext/tearoff.cc
+++ b/libs/gtkmm2ext/tearoff.cc
@@ -65,7 +65,7 @@ TearOff::TearOff (Widget& c, bool allow_resize)
VBox* box1;
box1 = manage (new VBox);
box1->pack_start (close_event_box, false, false, 2);
-
+
window_box.pack_end (*box1, false, false, 2);
own_window.add_events (KEY_PRESS_MASK|KEY_RELEASE_MASK|BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK|POINTER_MOTION_MASK|POINTER_MOTION_HINT_MASK);
@@ -73,7 +73,7 @@ TearOff::TearOff (Widget& c, bool allow_resize)
own_window.set_type_hint (WINDOW_TYPE_HINT_UTILITY);
own_window.add (window_box);
-
+
own_window.signal_button_press_event().connect (mem_fun (*this, &TearOff::window_button_press));
own_window.signal_button_release_event().connect (mem_fun (*this, &TearOff::window_button_release));
own_window.signal_motion_notify_event().connect (mem_fun (*this, &TearOff::window_motion));
@@ -171,7 +171,7 @@ TearOff::close_click (GdkEventButton* /*ev*/)
{
put_it_back ();
return true;
-}
+}
void
TearOff::put_it_back ()
@@ -232,7 +232,7 @@ TearOff::window_motion (GdkEventMotion* ev)
double x_delta;
double y_delta;
RefPtr<Gdk::Window> win (own_window.get_window());
-
+
own_window.get_pointer (mx, my);
if (!dragging) {
@@ -250,10 +250,10 @@ TearOff::window_motion (GdkEventMotion* ev)
win->get_root_origin (x, y);
win->move ((gint) floor (x + x_delta), (gint) floor (y + y_delta));
-
+
drag_x = ev->x_root;
drag_y = ev->y_root;
-
+
return true;
}
diff --git a/libs/gtkmm2ext/textviewer.cc b/libs/gtkmm2ext/textviewer.cc
index e62725acb4..995cbc8eaa 100644
--- a/libs/gtkmm2ext/textviewer.cc
+++ b/libs/gtkmm2ext/textviewer.cc
@@ -108,7 +108,7 @@ TextViewer::scroll_to_bottom ()
adj = scrollwin.get_vadjustment();
adj->set_value (MAX(0,(adj->get_upper() - adj->get_page_size())));
}
-
+
void
TextViewer::deliver ()
diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc
index 24940c718c..4cfc0b26a0 100644
--- a/libs/gtkmm2ext/utils.cc
+++ b/libs/gtkmm2ext/utils.cc
@@ -53,7 +53,7 @@ Gtkmm2ext::get_ink_pixel_size (Glib::RefPtr<Pango::Layout> layout,
int& height)
{
Pango::Rectangle ink_rect = layout->get_ink_extents ();
-
+
width = PANGO_PIXELS(ink_rect.get_width());
height = PANGO_PIXELS(ink_rect.get_height());
}
@@ -72,7 +72,7 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *
{
int width, height;
w.ensure_style ();
-
+
get_pixel_size (w.create_pango_layout (text), width, height);
w.set_size_request(width + hpadding, height + vpadding);
}
@@ -117,7 +117,7 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w, std::string c
{
int width, height;
w.ensure_style ();
-
+
get_pixel_size (w.create_pango_layout (text), width, height);
w.set_size_request(width + hpadding, height + vpadding);
}
@@ -141,7 +141,7 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
break;
}
}
-
+
if (i == strings.end()) {
/* make a copy of the strings then add one that has a descender */
copy = strings;
@@ -150,7 +150,7 @@ Gtkmm2ext::set_size_request_to_display_given_text (Gtk::Widget &w,
} else {
to_use = &strings;
}
-
+
for (vector<string>::const_iterator i = to_use->begin(); i != to_use->end(); ++i) {
get_pixel_size (w.create_pango_layout (*i), width, height);
width_max = max(width_max,width);
@@ -211,7 +211,7 @@ Gtkmm2ext::convert_bgra_to_rgba (guint8 const* src,
{
guint8 const* src_pixel = src;
guint8* dst_pixel = dst;
-
+
/* cairo pixel data is endian-dependent ARGB with A in the most significant 8 bits,
with premultipled alpha values (see preceding function)
@@ -251,7 +251,7 @@ Gtkmm2ext::convert_bgra_to_rgba (guint8 const* src,
#else
#error ardour does not currently support PDP-endianess
-#endif
+#endif
dst_pixel += 4;
src_pixel += 4;
@@ -277,16 +277,16 @@ Gtkmm2ext::pixbuf_from_string(const string& name, const Pango::FontDescription&
cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, clip_width, clip_height);
cairo_t* cr = cairo_create (surface);
cairo_text_extents_t te;
-
+
cairo_set_source_rgba (cr, fg.get_red_p(), fg.get_green_p(), fg.get_blue_p(), 1.0);
cairo_select_font_face (cr, font.get_family().c_str(),
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, font.get_size() / Pango::SCALE);
cairo_text_extents (cr, name.c_str(), &te);
-
+
cairo_move_to (cr, 0.5, int (0.5 - te.height / 2 - te.y_bearing + clip_height / 2));
cairo_show_text (cr, name.c_str());
-
+
convert_bgra_to_rgba(cairo_image_surface_get_data (surface), buf->get_pixels(), clip_width, clip_height);
cairo_destroy(cr);
@@ -765,10 +765,10 @@ Gtkmm2ext::fit_to_pixels (const string& str, int pixel_width, Pango::FontDescrip
/* XXX: might need special care to get the ellipsis character, not sure
how that works
- */
+ */
string s = string (layout->get_text ().substr(line->get_start_index(), line->get_length()));
-
+
cerr << "fit to pixels of " << str << " returns " << s << endl;
return s;
diff --git a/libs/gtkmm2ext/window_title.cc b/libs/gtkmm2ext/window_title.cc
index 11342ab1d7..eaf25a9f74 100644
--- a/libs/gtkmm2ext/window_title.cc
+++ b/libs/gtkmm2ext/window_title.cc
@@ -24,7 +24,7 @@
using namespace std;
namespace {
-
+
// I don't know if this should be translated.
const char* const title_separator = X_(" - ");
diff --git a/libs/midi++2/channel.cc b/libs/midi++2/channel.cc
index 85631ecc6d..b3cb42f593 100644
--- a/libs/midi++2/channel.cc
+++ b/libs/midi++2/channel.cc
@@ -31,7 +31,7 @@ Channel::Channel (MIDI::byte channelnum, Port &p)
_channel_number = channelnum;
reset (0, 1, false);
-}
+}
void
Channel::connect_signals ()
@@ -137,7 +137,7 @@ Channel::process_controller (Parser & /*parser*/, EventTwoBytes *tb)
} else if ((tb->controller_number >= 32 &&
tb->controller_number <= 63)) {
-
+
int cn = tb->controller_number - 32;
cv = (unsigned short) _controller_val[cn];
@@ -153,7 +153,7 @@ Channel::process_controller (Parser & /*parser*/, EventTwoBytes *tb)
high 7.
*/
-
+
if (_controller_14bit[cn] == false) {
_controller_14bit[cn] = true;
cv = (cv << 7) | (tb->value & 0x7f);
@@ -172,7 +172,7 @@ Channel::process_controller (Parser & /*parser*/, EventTwoBytes *tb)
} else {
/* controller can only take 7 bit values */
-
+
_controller_val[tb->controller_number] =
(controller_value_t) tb->value;
}
diff --git a/libs/midi++2/ipmidi_port.cc b/libs/midi++2/ipmidi_port.cc
index 622bf76d16..ace51eae7d 100644
--- a/libs/midi++2/ipmidi_port.cc
+++ b/libs/midi++2/ipmidi_port.cc
@@ -105,7 +105,7 @@ IPMIDIPort::close_sockets ()
::closesocket (sockin);
sockin = -1;
}
-
+
if (sockout >= 0) {
::closesocket (sockout);
sockout = -1;
@@ -171,12 +171,12 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
addrin.sin_family = AF_INET;
addrin.sin_addr.s_addr = htonl(INADDR_ANY);
addrin.sin_port = htons(base_port);
-
+
if (::bind(sockin, (struct sockaddr *) (&addrin), sizeof(addrin)) < 0) {
::perror("bind");
return false;
}
-
+
// Will Hall, 2007
// INADDR_ANY will bind to default interface,
// specify alternate interface nameon which to bind...
@@ -194,7 +194,7 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
} else {
if_addr_in.s_addr = htonl (INADDR_ANY);
}
-
+
struct ip_mreq mreq;
mreq.imr_multiaddr.s_addr = ::inet_addr("225.0.0.37");
mreq.imr_interface.s_addr = if_addr_in.s_addr;
@@ -212,7 +212,7 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
::perror("socket(out)");
return false;
}
-
+
// Will Hall, Oct 2007
if (!ifname.empty()) {
struct in_addr if_addr_out;
@@ -225,12 +225,12 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
return false;
}
}
-
+
::memset(&addrout, 0, sizeof(struct sockaddr_in));
addrout.sin_family = AF_INET;
addrout.sin_addr.s_addr = ::inet_addr("225.0.0.37");
addrout.sin_port = htons (base_port);
-
+
// Turn off loopback...
int loop = 0;
if (::setsockopt(sockout, IPPROTO_IP, IP_MULTICAST_LOOP, (char *) &loop, sizeof (loop)) < 0) {
@@ -247,7 +247,7 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
error << "cannot set non-blocking mode for IP MIDI output socket (" << ::strerror (errno) << ')' << endmsg;
return false;
}
-
+
return true;
#else
return false;
@@ -282,7 +282,7 @@ IPMIDIPort::parse (framecnt_t timestamp)
* parser. This will emit appropriate signals that will be handled
* by anyone who cares.
*/
-
+
unsigned char buf[1024];
struct sockaddr_in sender;
socklen_t slen = sizeof(sender);
@@ -291,7 +291,7 @@ IPMIDIPort::parse (framecnt_t timestamp)
if (r >= 0) {
_parser->set_timestamp (timestamp);
-
+
for (int i = 0; i < r; ++i) {
_parser->scanner (buf[i]);
}
diff --git a/libs/midi++2/midi++/channel.h b/libs/midi++2/midi++/channel.h
index d397c99ea0..6f4928209a 100644
--- a/libs/midi++2/midi++/channel.h
+++ b/libs/midi++2/midi++/channel.h
@@ -79,19 +79,19 @@ class LIBMIDIPP_API Channel : public PBD::ScopedConnectionList {
bool all_notes_off (timestamp_t timestamp) {
return channel_msg (MIDI::controller, 123, 0, timestamp);
}
-
+
bool control (byte id, byte value, timestamp_t timestamp) {
return channel_msg (MIDI::controller, id, value, timestamp);
}
-
+
bool note_on (byte note, byte velocity, timestamp_t timestamp) {
return channel_msg (MIDI::on, note, velocity, timestamp);
}
-
+
bool note_off (byte note, byte velocity, timestamp_t timestamp) {
return channel_msg (MIDI::off, note, velocity, timestamp);
}
-
+
bool aftertouch (byte value, timestamp_t timestamp) {
return channel_msg (MIDI::chanpress, value, 0, timestamp);
}
@@ -140,7 +140,7 @@ class LIBMIDIPP_API Channel : public PBD::ScopedConnectionList {
size_t _notes_on;
void reset (timestamp_t timestamp, framecnt_t nframes, bool notes_off = true);
-
+
void process_note_off (Parser &, EventTwoBytes *);
void process_note_on (Parser &, EventTwoBytes *);
void process_controller (Parser &, EventTwoBytes *);
diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h
index 9e37253e52..313208892f 100644
--- a/libs/midi++2/midi++/ipmidi_port.h
+++ b/libs/midi++2/midi++/ipmidi_port.h
@@ -69,7 +69,7 @@ class LIBMIDIPP_API IPMIDIPort : public Port {
static const int lowest_ipmidi_port_default = 21928;
-private:
+private:
int sockin;
int sockout;
struct sockaddr_in addrout;
diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h
index 45a251457e..e252e76fe1 100644
--- a/libs/midi++2/midi++/midnam_patch.h
+++ b/libs/midi++2/midi++/midnam_patch.h
@@ -48,18 +48,18 @@ public:
: _bank(std::max(0, std::min(bank_num, 16383)))
, _program(std::max(0, std::min(program_num, 127)))
{}
-
+
inline PatchPrimaryKey& operator=(const PatchPrimaryKey& id) {
_bank = id._bank;
_program = id._program;
return *this;
}
-
+
inline bool operator==(const PatchPrimaryKey& id) const {
return (_bank == id._bank &&
_program == id._program);
}
-
+
/** Strict weak ordering. */
inline bool operator<(const PatchPrimaryKey& id) const {
if (_bank < id._bank) {
@@ -82,7 +82,7 @@ private:
};
class PatchBank;
-
+
class LIBMIDIPP_API Patch
{
public:
@@ -92,7 +92,7 @@ public:
const std::string& name() const { return _name; }
void set_name(const std::string& name) { _name = name; }
-
+
const std::string& note_list_name() const { return _note_list_name; }
uint8_t program_number() const { return _id.program(); }
@@ -154,17 +154,17 @@ public:
const std::string& name() const { return _name; }
void set_name(const std::string& name) { _name = name; }
-
+
const PatchBanks& patch_banks() const { return _patch_banks; }
bool available_for_channel(uint8_t channel) const {
return _available_for_channels.find(channel) != _available_for_channels.end();
}
-
+
boost::shared_ptr<Patch> find_patch(const PatchPrimaryKey& key) {
return _patch_map[key];
}
-
+
boost::shared_ptr<Patch> previous_patch(const PatchPrimaryKey& key) {
for (PatchList::const_iterator i = _patch_list.begin();
i != _patch_list.end();
@@ -176,10 +176,10 @@ public:
}
}
}
-
+
return boost::shared_ptr<Patch>();
}
-
+
boost::shared_ptr<Patch> next_patch(const PatchPrimaryKey& key) {
for (PatchList::const_iterator i = _patch_list.begin();
i != _patch_list.end();
@@ -192,7 +192,7 @@ public:
}
}
}
-
+
return boost::shared_ptr<Patch>();
}
@@ -378,16 +378,16 @@ public:
const std::string& name() const { return _name; }
void set_name(const std::string& name) { _name = name; }
-
+
XMLNode& get_state (void);
int set_state (const XMLTree&, const XMLNode&);
-
+
/// Note: channel here is 0-based while in the MIDNAM-file it's 1-based
const std::string& channel_name_set_name_by_channel(uint8_t channel) {
assert(channel <= 15);
return _channel_name_set_assignments[channel];
}
-
+
private:
/// array index = channel number
/// string contents = name of channel name set
@@ -408,13 +408,13 @@ public:
typedef std::map<std::string, boost::shared_ptr<ControlNameList> > ControlNameLists;
typedef std::map<std::string, boost::shared_ptr<ValueNameList> > ValueNameLists;
typedef std::map<std::string, PatchNameList> PatchNameLists;
-
+
MasterDeviceNames() {};
virtual ~MasterDeviceNames() {};
-
+
const std::string& manufacturer() const { return _manufacturer; }
void set_manufacturer(const std::string& manufacturer) { _manufacturer = manufacturer; }
-
+
const Models& models() const { return _models; }
void set_models(const Models some_models) { _models = some_models; }
@@ -427,7 +427,7 @@ public:
uint8_t number);
const CustomDeviceModeNames& custom_device_mode_names() const { return _custom_device_mode_names; }
-
+
boost::shared_ptr<CustomDeviceMode> custom_device_mode_by_name(const std::string& mode_name);
boost::shared_ptr<ChannelNameSet> channel_name_set_by_channel(const std::string& mode, uint8_t channel);
boost::shared_ptr<Patch> find_patch(const std::string& mode, uint8_t channel, const PatchPrimaryKey& key);
@@ -445,7 +445,7 @@ public:
XMLNode& get_state (void);
int set_state (const XMLTree&, const XMLNode&);
-
+
private:
std::string _manufacturer;
Models _models;
@@ -463,20 +463,20 @@ class LIBMIDIPP_API MIDINameDocument
public:
// Maps Model names to MasterDeviceNames
typedef std::map<std::string, boost::shared_ptr<MasterDeviceNames> > MasterDeviceNamesList;
-
+
MIDINameDocument() {}
MIDINameDocument(const std::string& filename);
virtual ~MIDINameDocument() {};
const std::string& author() const { return _author; }
void set_author(const std::string& author) { _author = author; }
-
+
boost::shared_ptr<MasterDeviceNames> master_device_names(const std::string& model);
const MasterDeviceNamesList& master_device_names_by_model() const { return _master_device_names_list; }
-
+
const MasterDeviceNames::Models& all_models() const { return _all_models; }
-
+
XMLNode& get_state (void);
int set_state (const XMLTree&, const XMLNode&);
diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h
index 3529031caf..caf1605c29 100644
--- a/libs/midi++2/midi++/mmc.h
+++ b/libs/midi++2/midi++/mmc.h
@@ -60,10 +60,10 @@ class LIBMIDIPP_API MachineControl
cmdChase = 0xB,
cmdCommandErrorReset = 0xC,
cmdMmcReset = 0xD,
-
+
cmdIllegalMackieJogStart = 0x20,
cmdIllegalMackieJogStop = 0x21,
-
+
cmdWrite = 0x40,
cmdMaskedWrite = 0x41,
cmdRead = 0x42,
@@ -93,14 +93,14 @@ class LIBMIDIPP_API MachineControl
cmdWait = 0x7C,
cmdResume = 0x7F
};
-
+
MachineControl ();
void set_ports (MIDI::Port* input, MIDI::Port* output);
Port* input_port() { return _input_port; }
Port* output_port() { return _output_port; }
-
+
void set_receive_device_id (byte id);
void set_send_device_id (byte id);
byte receive_device_id () const { return _receive_device_id; }
@@ -114,7 +114,7 @@ class LIBMIDIPP_API MachineControl
/* Signals to connect to if you want to run "callbacks"
when certain MMC commands are received.
*/
-
+
MMCSignal Stop;
MMCSignal Play;
MMCSignal DeferredPlay;
@@ -159,7 +159,7 @@ class LIBMIDIPP_API MachineControl
/* The second argument is the shuttle speed, the third is
true if the direction is "forwards", false for "reverse"
*/
-
+
PBD::Signal3<void,MachineControl&,float,bool> Shuttle;
/* The second argument specifies the desired track record enabled
@@ -168,14 +168,14 @@ class LIBMIDIPP_API MachineControl
PBD::Signal3<void,MachineControl &,size_t,bool>
TrackRecordStatusChange;
-
+
/* The second argument specifies the desired track record enabled
status.
*/
PBD::Signal3<void,MachineControl &,size_t,bool>
TrackMuteChange;
-
+
/* The second argument points to a byte array containing
the locate target value in MMC Standard Time Code
format (5 bytes, roughly: hrs/mins/secs/frames/subframes)
@@ -184,13 +184,13 @@ class LIBMIDIPP_API MachineControl
PBD::Signal2<void,MachineControl &, const byte *> Locate;
/* The second argument is the number of steps to jump */
-
+
PBD::Signal2<void,MachineControl &, int> Step;
#define MMC_NTRACKS 48
/* note: these are not currently in use */
-
+
byte updateRate;
byte responseError;
byte commandError;
@@ -261,7 +261,7 @@ class LIBMIDIPP_API MachineControl
byte responseSegment;
byte wait;
byte resume;
-
+
private:
byte _receive_device_id;
byte _send_device_id;
@@ -276,7 +276,7 @@ class LIBMIDIPP_API MachineControl
int do_locate (byte *, size_t len);
int do_step (byte *, size_t len);
int do_shuttle (byte *, size_t len);
-
+
void write_track_status (byte *, size_t len, byte reg);
void spp_start ();
void spp_continue ();
@@ -293,7 +293,7 @@ public:
MachineControlCommand () : _command (MachineControl::Command (0)) {}
MachineControlCommand (MachineControl::Command);
MachineControlCommand (Timecode::Time);
-
+
MIDI::byte* fill_buffer (MachineControl *mmc, MIDI::byte *) const;
private:
diff --git a/libs/midi++2/midi++/parser.h b/libs/midi++2/midi++/parser.h
index 05d674375c..0f2ecf49fd 100644
--- a/libs/midi++2/midi++/parser.h
+++ b/libs/midi++2/midi++/parser.h
@@ -50,12 +50,12 @@ class LIBMIDIPP_API Parser {
message the next time ::scanner() parses such a message. It should
therefore be set before every byte passed into ::scanner().
*/
-
+
framecnt_t get_timestamp() const { return _timestamp; }
void set_timestamp (const framecnt_t timestamp) { _timestamp = timestamp; }
/* signals that anyone can connect to */
-
+
BankSignal bank_change;
TwoByteSignal note_on;
TwoByteSignal note_off;
@@ -124,7 +124,7 @@ class LIBMIDIPP_API Parser {
MTC_Status mtc_running() const { return _mtc_running; }
const byte *mtc_current() const { return _mtc_time; }
bool mtc_locked() const { return _mtc_locked; }
-
+
PBD::Signal3<void, Parser &, int, framecnt_t> mtc_qtr;
PBD::Signal3<void, const byte *, bool, framecnt_t> mtc_time;
PBD::Signal1<void, MTC_Status> mtc_status;
@@ -135,10 +135,10 @@ class LIBMIDIPP_API Parser {
}
void reset_mtc_state ();
-
+
private:
/* tracing */
-
+
std::ostream *trace_stream;
std::string trace_prefix;
void trace_event (Parser &p, byte *msg, size_t len);
@@ -171,7 +171,7 @@ class LIBMIDIPP_API Parser {
MTC_Status _mtc_running;
bool _mtc_locked;
byte last_qtr_frame;
-
+
framecnt_t _timestamp;
ParseState pre_variable_state;
diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h
index 1f85b53cd4..6d933f6a6d 100644
--- a/libs/midi++2/midi++/port.h
+++ b/libs/midi++2/midi++/port.h
@@ -46,7 +46,7 @@ class LIBMIDIPP_API Port {
IsInput = 0x1, /* MUST MATCH JACK's JackPortIsInput */
IsOutput = 0x2, /* MUST MATCH JACK's JackPortIsOutput */
};
-
+
Port (std::string const &, Flags);
Port (const XMLNode&);
virtual ~Port ();
@@ -99,11 +99,11 @@ class LIBMIDIPP_API Port {
Channel *channel (channel_t chn) {
return _channel[chn&0x7F];
}
-
+
Parser* parser () {
return _parser;
}
-
+
const char *name () const { return _tagname.c_str(); }
bool ok () const { return _ok; }
diff --git a/libs/midi++2/miditrace.cc b/libs/midi++2/miditrace.cc
index 21cd3ba457..1b8c107b87 100644
--- a/libs/midi++2/miditrace.cc
+++ b/libs/midi++2/miditrace.cc
@@ -58,7 +58,7 @@ main (int argc, char *argv[])
{
byte buf[1];
-
+
text_receiver.listen_to (error);
text_receiver.listen_to (info);
text_receiver.listen_to (fatal);
diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc
index 9f62c12dfe..2205e5e2a0 100644
--- a/libs/midi++2/midnam_patch.cc
+++ b/libs/midi++2/midnam_patch.cc
@@ -35,7 +35,7 @@ namespace MIDI
namespace Name
{
-
+
Patch::Patch (std::string name, uint8_t p_number, uint16_t b_number)
: _name (name)
, _id (p_number, b_number)
@@ -138,7 +138,7 @@ Patch::set_state (const XMLTree& tree, const XMLNode& node)
return -1; // Failed to find a program number anywhere
}
}
-
+
XMLNode* use_note_name_list = node.child("UsesNoteNameList");
if (use_note_name_list) {
_note_list_name = use_note_name_list->property ("Name")->value();
@@ -478,7 +478,7 @@ operator<< (std::ostream& os, const ChannelNameSet& cns)
os << (int) (*x) << ' ';
}
os << endl;
-
+
for (ChannelNameSet::PatchBanks::const_iterator pbi = cns._patch_banks.begin(); pbi != cns._patch_banks.end(); ++pbi) {
os << "\tPatch Bank " << (*pbi)->name() << " with " << (*pbi)->patch_name_list().size() << " patches\n";
for (PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) {
@@ -493,12 +493,12 @@ void
ChannelNameSet::set_patch_banks (const ChannelNameSet::PatchBanks& pb)
{
_patch_banks = pb;
-
+
_patch_map.clear ();
_patch_list.clear ();
_patch_list_name = "";
_available_for_channels.clear ();
-
+
for (PatchBanks::const_iterator pbi = _patch_banks.begin(); pbi != _patch_banks.end(); ++pbi) {
for (PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) {
_patch_map[(*pni)->patch_primary_key()] = (*pni);
@@ -898,7 +898,7 @@ MIDINameDocument::set_state (const XMLTree& tree, const XMLNode&)
error << "No author information in MIDNAM file" << endmsg;
return -1;
}
-
+
if (author->front()->children().size() > 0) {
_author = author->front()->children().front()->content();
}
@@ -922,7 +922,7 @@ MIDINameDocument::set_state (const XMLTree& tree, const XMLNode&)
_master_device_names_list.insert(
std::pair<std::string, boost::shared_ptr<MasterDeviceNames> >
(*model, master_device_names));
-
+
_all_models.insert(*model);
}
}
diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc
index 074064f7bd..d9ad077865 100644
--- a/libs/midi++2/mmc.cc
+++ b/libs/midi++2/mmc.cc
@@ -256,7 +256,7 @@ MachineControl::is_mmc (MIDI::byte *sysex_buf, size_t len)
sysex_buf[3] != 0x7) { /* MMC Response */
return false;
}
-
+
return true;
}
@@ -465,7 +465,7 @@ MachineControl::process_mmc_message (Parser &, MIDI::byte *msg, size_t len)
len -= skiplen;
} while (len > 1); /* skip terminating EOX byte */
-}
+}
int
MachineControl::do_masked_write (MIDI::byte *msg, size_t len)
@@ -473,7 +473,7 @@ MachineControl::do_masked_write (MIDI::byte *msg, size_t len)
/* return the number of bytes "consumed" */
int retval = msg[1] + 2; /* bytes following + 2 */
-
+
switch (msg[2]) {
case 0x4f: /* Track Record Ready Status */
write_track_status (&msg[3], len - 3, msg[2]);
@@ -508,7 +508,7 @@ MachineControl::write_track_status (MIDI::byte *msg, size_t /*len*/, MIDI::byte
bit 4: aux track b
the format of the message (its an MMC Masked Write) is:
-
+
0x41 Command Code
<count> byte count of following data
<name> byte value of the field being written
@@ -516,7 +516,7 @@ MachineControl::write_track_status (MIDI::byte *msg, size_t /*len*/, MIDI::byte
bitmap being written to
<mask> ones in the mask indicate which bits will be changed
<data> new data for the byte being written
-
+
by the time this code is executing, msg[0] is the
byte number of the target byte. if its zero, we
are writing to a special byte in the standard
@@ -524,20 +524,20 @@ MachineControl::write_track_status (MIDI::byte *msg, size_t /*len*/, MIDI::byte
special. hence the bits for tracks 1 + 2 are bits
5 and 6 of the first byte of the track
bitmap. so:
-
+
change track 1: msg[0] = 0; << first byte of track bitmap
msg[1] = 0100000; << binary: bit 5 set
-
+
change track 2: msg[0] = 0; << first byte of track bitmap
msg[1] = 1000000; << binary: bit 6 set
-
+
change track 3: msg[0] = 1; << second byte of track bitmap
msg[1] = 0000001; << binary: bit 0 set
-
+
the (msg[0] * 8) - 6 computation is an attempt to
extract the value of the first track: ie. the one
that would be indicated by bit 0 being set.
-
+
so, if msg[0] = 0, msg[1] = 0100000 (binary),
what happens is that base_track = -5, but by the
time we check the correct bit, n = 5, and so the
@@ -565,13 +565,13 @@ MachineControl::write_track_status (MIDI::byte *msg, size_t /*len*/, MIDI::byte
*/
bool val = (msg[2] & (1<<n));
-
+
switch (reg) {
case 0x4f:
trackRecordStatus[base_track+n] = val;
TrackRecordStatusChange (*this, base_track+n, val);
break;
-
+
case 0x62:
trackMute[base_track+n] = val;
TrackMuteChange (*this, base_track+n, val);
@@ -627,7 +627,7 @@ MachineControl::do_shuttle (MIDI::byte *msg, size_t /*msglen*/)
} else {
forward = true;
}
-
+
left_shift = (sh & 0x38);
integral = ((sh & 0x7) << left_shift) | (sm >> (7 - left_shift));
diff --git a/libs/midi++2/mmctest.cc b/libs/midi++2/mmctest.cc
index 9259e3ad2b..e81126cba7 100644
--- a/libs/midi++2/mmctest.cc
+++ b/libs/midi++2/mmctest.cc
@@ -102,7 +102,7 @@ main (int argc, char *argv[])
{
byte buf[1];
-
+
text_receiver.listen_to (error);
text_receiver.listen_to (info);
text_receiver.listen_to (fatal);
diff --git a/libs/midi++2/mtc.cc b/libs/midi++2/mtc.cc
index f23c6d832c..7f7506c344 100644
--- a/libs/midi++2/mtc.cc
+++ b/libs/midi++2/mtc.cc
@@ -45,12 +45,12 @@ Parser::possible_mtc (MIDI::byte *sysex_buf, size_t msglen)
}
/* full MTC */
-
+
fake_mtc_time[0] = sysex_buf[8]; // frames
fake_mtc_time[1] = sysex_buf[7]; // minutes
fake_mtc_time[2] = sysex_buf[6]; // seconds
fake_mtc_time[3] = (sysex_buf[5] & 0x1f); // hours
-
+
_mtc_fps = MTC_FPS ((sysex_buf[5] & 0x60) >> 5); // fps
fake_mtc_time[4] = (byte) _mtc_fps;
@@ -108,7 +108,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
#endif
if (_mtc_running == MTC_Stopped) {
-
+
/* we are stopped but are seeing qtr frame messages */
if (consecutive_qtr_frame_cnt == 0) {
@@ -116,11 +116,11 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
/* first quarter frame */
if (which_quarter_frame != 0 && which_quarter_frame != 7) {
-
+
last_qtr_frame = which_quarter_frame;
consecutive_qtr_frame_cnt++;
}
-
+
// cerr << "first seen qframe = " << (int) last_qtr_frame << endl;
return;
@@ -128,7 +128,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
} else if (consecutive_qtr_frame_cnt == 1) {
/* third quarter frame */
-
+
#ifdef DEBUG_MTC
cerr << "second seen qframe = " << (int) which_quarter_frame << endl;
#endif
@@ -155,7 +155,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
case MTC_Backward:
if (which_quarter_frame == 0) {
expected_mtc_quarter_frame_code = 7;
-
+
} else {
expected_mtc_quarter_frame_code = which_quarter_frame - 1;
}
@@ -164,9 +164,9 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
case MTC_Stopped:
break;
}
-
+
} else {
-
+
/* already running */
// for testing bad MIDI connections etc.
@@ -186,7 +186,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
*/
boost::optional<bool> res = mtc_skipped ();
-
+
if (res.get_value_or (false)) {
/* no error, reset next expected frame */
@@ -203,7 +203,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
case MTC_Backward:
if (which_quarter_frame == 0) {
expected_mtc_quarter_frame_code = 7;
-
+
} else {
expected_mtc_quarter_frame_code = which_quarter_frame - 1;
}
@@ -215,7 +215,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
#ifdef DEBUG_MTC
cerr << "SKIPPED, next expected = " << expected_mtc_quarter_frame_code << endl;
-#endif
+#endif
return;
}
@@ -226,7 +226,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
#endif
reset_mtc_state ();
mtc_status (MTC_Stopped);
-
+
return;
} else {
@@ -267,18 +267,18 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
case 5: // minutes MS nibble
_qtr_mtc_time[2] |= (msg[1] & 0xf)<<4;
break;
-
+
case 6: // hours LS nibble
_qtr_mtc_time[3] |= msg[1] & 0xf;
break;
case 7:
-
+
/* last quarter frame msg has the MS bit of
the hour in bit 0, and the SMPTE FPS type
in bits 5 and 6
*/
-
+
_qtr_mtc_time[3] |= ((msg[1] & 0x1) << 4);
_mtc_fps = MTC_FPS ((msg[1] & 0x6) >> 1);
_qtr_mtc_time[4] = _mtc_fps;
@@ -289,7 +289,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
break;
}
-
+
#ifdef DEBUG_MTC
cerr << "Emit MTC Qtr\n";
#endif
@@ -301,12 +301,12 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
switch (_mtc_running) {
case MTC_Forward:
if (which_quarter_frame == 7) {
-
+
/* we've reached the final of 8 quarter frame messages.
store the time, reset the pending time holder,
and signal anyone who wants to know the time.
*/
-
+
if (consecutive_qtr_frame_cnt >= 8) {
memcpy (_mtc_time, _qtr_mtc_time, sizeof (_mtc_time));
memset (_qtr_mtc_time, 0, sizeof (_qtr_mtc_time));
@@ -317,15 +317,15 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
mtc_time (_mtc_time, false, _timestamp);
}
expected_mtc_quarter_frame_code = 0;
-
+
} else {
expected_mtc_quarter_frame_code = which_quarter_frame + 1;
}
break;
-
+
case MTC_Backward:
if (which_quarter_frame == 0) {
-
+
/* we've reached the final of 8 quarter frame messages.
store the time, reset the pending time holder,
and signal anyone who wants to know the time.
diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc
index f324047713..e11094d26f 100644
--- a/libs/midi++2/parser.cc
+++ b/libs/midi++2/parser.cc
@@ -50,55 +50,55 @@ Parser::midi_event_type_name (eventType t)
case MIDI::any:
return "any midi message";
-
+
case off:
return "note off";
-
+
case on:
return "note on";
-
+
case polypress:
return "aftertouch";
-
+
case MIDI::controller:
return "controller";
-
+
case program:
return "program change";
-
+
case chanpress:
return "channel pressure";
-
+
case MIDI::pitchbend:
return "pitch bend";
-
+
case MIDI::sysex:
return "system exclusive";
-
+
case MIDI::song:
return "song position";
-
+
case MIDI::tune:
return "tune";
-
+
case MIDI::eox:
return "end of sysex";
-
+
case MIDI::timing:
return "timing";
-
+
case MIDI::start:
return "start";
-
+
case MIDI::stop:
return "continue";
-
+
case MIDI::contineu:
return "stop";
-
+
case active:
return "active sense";
-
+
default:
return "unknow MIDI event type";
}
@@ -144,7 +144,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
if ((o = trace_stream) == NULL) { /* can be asynchronously removed */
return;
}
-
+
type = (eventType) (msg[0]&0xF0);
switch (type) {
@@ -158,7 +158,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< (int) msg[2]
<< endmsg;
break;
-
+
case on:
*o << trace_prefix
<< "Channel "
@@ -169,7 +169,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< (int) msg[2]
<< endmsg;
break;
-
+
case polypress:
*o << trace_prefix
<< "Channel "
@@ -178,7 +178,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< (int) msg[1]
<< endmsg;
break;
-
+
case MIDI::controller:
*o << trace_prefix
<< "Channel "
@@ -189,7 +189,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< (int) msg[2]
<< endmsg;
break;
-
+
case program:
*o << trace_prefix
<< "Channel "
@@ -198,7 +198,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< (int) msg[1]
<< endmsg;
break;
-
+
case chanpress:
*o << trace_prefix
<< "Channel "
@@ -207,7 +207,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< (int) msg[1]
<< endmsg;
break;
-
+
case MIDI::pitchbend:
*o << trace_prefix
<< "Channel "
@@ -216,7 +216,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
<< ((msg[2]<<7)|msg[1])
<< endmsg;
break;
-
+
case MIDI::sysex:
if (len == 1) {
switch (msg[0]) {
@@ -253,7 +253,7 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
default:
*o << trace_prefix
<< "System Exclusive (1 byte : " << hex << (int) *msg << dec << ')'
- << endmsg;
+ << endmsg;
break;
}
} else {
@@ -263,42 +263,42 @@ Parser::trace_event (Parser &, MIDI::byte *msg, size_t len)
*o << (int) msgbuf[i] << ' ';
}
*o << dec << ']' << endmsg;
-
+
}
break;
-
+
case MIDI::song:
*o << trace_prefix << "Song" << endmsg;
break;
-
+
case MIDI::tune:
*o << trace_prefix << "Tune" << endmsg;
break;
-
+
case MIDI::eox:
*o << trace_prefix << "End-of-System Exclusive" << endmsg;
break;
-
+
case MIDI::timing:
*o << trace_prefix << "Timing" << endmsg;
break;
-
+
case MIDI::start:
*o << trace_prefix << "Start" << endmsg;
break;
-
+
case MIDI::stop:
*o << trace_prefix << "Stop" << endmsg;
break;
-
+
case MIDI::contineu:
*o << trace_prefix << "Continue" << endmsg;
break;
-
+
case active:
*o << trace_prefix << "Active Sense" << endmsg;
break;
-
+
default:
*o << trace_prefix << "Unrecognized MIDI message" << endmsg;
break;
@@ -327,9 +327,9 @@ Parser::scanner (unsigned char inbyte)
boost::optional<int> edit_result;
// cerr << "parse: " << hex << (int) inbyte << dec << " state = " << state << " msgindex = " << msgindex << " runnable = " << runnable << endl;
-
+
/* Check active sensing early, so it doesn't interrupt sysex.
-
+
NOTE: active sense messages are not considered to fit under
"any" for the purposes of callbacks. If a caller wants
active sense messages handled, which is unlikely, then
@@ -337,7 +337,7 @@ Parser::scanner (unsigned char inbyte)
every other MIDI message in terms of semantics that its
counter-productive to treat them similarly.
*/
-
+
if (inbyte == 0xfe) {
message_counter[inbyte]++;
if (!_offline) {
@@ -345,21 +345,21 @@ Parser::scanner (unsigned char inbyte)
}
return;
}
-
+
/* If necessary, allocate larger message buffer. */
-
+
if (msgindex >= msglen) {
msglen *= 2;
msgbuf = (unsigned char *) realloc (msgbuf, msglen);
}
-
+
/*
Real time messages can occur ANYPLACE,
but do not interrupt running status.
*/
bool rtmsg = false;
-
+
switch (inbyte) {
case 0xf8:
rtmsg = true;
@@ -386,11 +386,11 @@ Parser::scanner (unsigned char inbyte)
if (rtmsg) {
boost::optional<int> res = edit (&inbyte, 1);
-
+
if (res.get_value_or (1) >= 0 && !_offline) {
realtime_msg (inbyte);
}
-
+
return;
}
@@ -438,11 +438,11 @@ Parser::scanner (unsigned char inbyte)
}
}
}
-
+
/*
* Status bytes always start a new message, except EOX
*/
-
+
if (statusbit) {
msgindex = 0;
@@ -469,11 +469,11 @@ Parser::scanner (unsigned char inbyte)
return;
}
-
+
/*
* We've got a Data byte.
*/
-
+
msgbuf[msgindex++] = inbyte;
switch (state) {
@@ -487,29 +487,29 @@ Parser::scanner (unsigned char inbyte)
* messages, so just handle it silently.
*/
break;
-
+
case NEEDTWOBYTES:
/* wait for the second byte */
if (msgindex < 3)
return;
/*FALLTHRU*/
-
+
case NEEDONEBYTE:
/* We've completed a 1 or 2 byte message. */
edit_result = edit (msgbuf, msgindex);
if (edit_result.get_value_or (1)) {
-
+
/* message not cancelled by an editor */
-
+
message_counter[msgbuf[0] & 0xF0]++;
if (!_offline) {
signal (msgbuf, msgindex);
}
}
-
+
if (runnable) {
/* In Runnable mode, we reset the message
index, but keep the callbacks_pending and state the
@@ -522,7 +522,7 @@ Parser::scanner (unsigned char inbyte)
state = NEEDSTATUS;
}
break;
-
+
case VARIABLELENGTH:
/* nothing to do */
break;
@@ -666,7 +666,7 @@ Parser::signal (MIDI::byte *msg, size_t len)
switch (msgtype) {
case none:
break;
-
+
case off:
channel_active_preparse[chan_i] (*this);
note_off (*this, (EventTwoBytes *) &msg[1]);
@@ -674,7 +674,7 @@ Parser::signal (MIDI::byte *msg, size_t len)
(*this, (EventTwoBytes *) &msg[1]);
channel_active_postparse[chan_i] (*this);
break;
-
+
case on:
channel_active_preparse[chan_i] (*this);
@@ -694,7 +694,7 @@ Parser::signal (MIDI::byte *msg, size_t len)
channel_active_postparse[chan_i] (*this);
break;
-
+
case MIDI::controller:
channel_active_preparse[chan_i] (*this);
controller (*this, (EventTwoBytes *) &msg[1]);
@@ -702,21 +702,21 @@ Parser::signal (MIDI::byte *msg, size_t len)
(*this, (EventTwoBytes *) &msg[1]);
channel_active_postparse[chan_i] (*this);
break;
-
+
case program:
channel_active_preparse[chan_i] (*this);
program_change (*this, msg[1]);
channel_program_change[chan_i] (*this, msg[1]);
channel_active_postparse[chan_i] (*this);
break;
-
+
case chanpress:
channel_active_preparse[chan_i] (*this);
pressure (*this, msg[1]);
channel_pressure[chan_i] (*this, msg[1]);
channel_active_postparse[chan_i] (*this);
break;
-
+
case polypress:
channel_active_preparse[chan_i] (*this);
poly_pressure (*this, (EventTwoBytes *) &msg[1]);
@@ -724,14 +724,14 @@ Parser::signal (MIDI::byte *msg, size_t len)
(*this, (EventTwoBytes *) &msg[1]);
channel_active_postparse[chan_i] (*this);
break;
-
+
case MIDI::pitchbend:
channel_active_preparse[chan_i] (*this);
pitchbend (*this, (msg[2]<<7)|msg[1]);
channel_pitchbend[chan_i] (*this, (msg[2]<<7)|msg[1]);
channel_active_postparse[chan_i] (*this);
break;
-
+
case MIDI::sysex:
sysex (*this, msg, len);
break;
@@ -740,23 +740,23 @@ Parser::signal (MIDI::byte *msg, size_t len)
process_mtc_quarter_frame (msg);
mtc_quarter_frame (*this, *msg);
break;
-
+
case MIDI::position:
position (*this, msg, len);
break;
-
+
case MIDI::song:
song (*this, msg, len);
break;
-
+
case MIDI::tune:
tune (*this);
-
+
default:
/* XXX some kind of warning ? */
break;
}
-
+
any (*this, msg, len);
}
@@ -788,7 +788,7 @@ Parser::set_offline (bool yn)
/* this hack deals with the possibility of our first MIDI
bytes being running status messages.
*/
-
+
channel_msg (0x90);
state = NEEDSTATUS;
}
diff --git a/libs/midi++2/port.cc b/libs/midi++2/port.cc
index d214755248..629dff0796 100644
--- a/libs/midi++2/port.cc
+++ b/libs/midi++2/port.cc
@@ -92,11 +92,11 @@ bool
Port::clock (timestamp_t timestamp)
{
static byte clockmsg = 0xf8;
-
+
if (sends_output()) {
return midimsg (&clockmsg, 1, timestamp);
}
-
+
return false;
}
@@ -150,7 +150,7 @@ Port::get_state () const
} else {
root->add_property ("mode", "output");
}
-
+
#if 0
byte device_inquiry[6];
@@ -160,7 +160,7 @@ Port::get_state () const
device_inquiry[0] = 0x06;
device_inquiry[0] = 0x02;
device_inquiry[0] = 0xf7;
-
+
write (device_inquiry, sizeof (device_inquiry), 0);
#endif
diff --git a/libs/panners/1in2out/panner_1in2out.cc b/libs/panners/1in2out/panner_1in2out.cc
index 30f71032f4..b4a1dd69bd 100644
--- a/libs/panners/1in2out/panner_1in2out.cc
+++ b/libs/panners/1in2out/panner_1in2out.cc
@@ -243,7 +243,7 @@ Panner1in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
if (pan != 0.0f) {
/* pan is not 1 but also not 0, so we must do it "properly" */
-
+
mix_buffers_with_gain(dst,src,nframes,pan);
/* XXX it would be nice to mark the buffer as written to */
@@ -252,7 +252,7 @@ Panner1in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
} else {
/* pan is 1 so we can just copy the input samples straight in */
-
+
mix_buffers_no_gain(dst,src,nframes);
/* XXX it would be nice to mark the buffer as written to */
diff --git a/libs/panners/2in2out/panner_2in2out.cc b/libs/panners/2in2out/panner_2in2out.cc
index 73d193d73b..3cfc358530 100644
--- a/libs/panners/2in2out/panner_2in2out.cc
+++ b/libs/panners/2in2out/panner_2in2out.cc
@@ -311,7 +311,7 @@ Panner2in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
if (pan != 0.0f) {
/* pan is 1 but also not 0, so we must do it "properly" */
-
+
//obufs.get_audio(1).read_from (srcbuf, nframes);
mix_buffers_with_gain(dst,src,nframes,pan);
@@ -369,17 +369,17 @@ Panner2in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
if (pan != 0.0f) {
/* pan is not 1 but also not 0, so we must do it "properly" */
-
+
mix_buffers_with_gain(dst,src,nframes,pan);
// obufs.get_audio(1).read_from (srcbuf, nframes);
-
+
/* XXX it would be nice to mark the buffer as written to */
}
} else {
/* pan is 1 so we can just copy the input samples straight in */
-
+
mix_buffers_no_gain(dst,src,nframes);
/* XXX it would be nice to mark the buffer as written to */
diff --git a/libs/panners/2in2out/panner_2in2out.h b/libs/panners/2in2out/panner_2in2out.h
index 9dc7826f67..bc81234eda 100644
--- a/libs/panners/2in2out/panner_2in2out.h
+++ b/libs/panners/2in2out/panner_2in2out.h
@@ -51,7 +51,7 @@ class Panner2in2out : public Panner
std::pair<double, double> position_range () const;
std::pair<double, double> width_range () const;
-
+
void set_position (double);
void set_width (double);
diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc
index 1b48a19eff..09dfa74785 100644
--- a/libs/pbd/base_ui.cc
+++ b/libs/pbd/base_ui.cc
@@ -42,7 +42,7 @@
using namespace std;
using namespace PBD;
using namespace Glib;
-
+
uint64_t BaseUI::rt_bit = 1;
BaseUI::RequestType BaseUI::CallSlot = BaseUI::new_request_type();
BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
@@ -91,7 +91,7 @@ BaseUI::signal_running ()
{
Glib::Threads::Mutex::Lock lm (_run_lock);
_running.signal ();
-
+
return false; // don't call it again
}
@@ -130,7 +130,7 @@ BaseUI::request_handler (Glib::IOCondition ioc)
if (ioc & IO_IN) {
request_channel.drain ();
-
+
/* there may been an error. we'd rather handle requests first,
and then get IO_HUP or IO_ERR on the next loop.
*/
diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc
index 9d152a6f86..e1c6571f9c 100644
--- a/libs/pbd/boost_debug.cc
+++ b/libs/pbd/boost_debug.cc
@@ -64,7 +64,7 @@ Backtrace::print (std::ostream& str) const
if (size) {
#ifdef HAVE_EXECINFO
strings = ::backtrace_symbols (trace, size);
-#endif
+#endif
if (strings) {
for (i = 3; i < 5+18 && i < size; i++) {
str << strings[i] << std::endl;
@@ -151,7 +151,7 @@ is_interesting_object (void const* ptr)
if (ptr == 0) {
return false;
}
-
+
return interesting_pointers().find (ptr) != interesting_pointers().end();
}
@@ -194,10 +194,10 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int
if (is_interesting_object (old_obj)) {
if (debug_out) {
cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count
- << " (total sp's = " << sptrs().size() << ')' << endl;
+ << " (total sp's = " << sptrs().size() << ')' << endl;
}
PointerMap::iterator x = sptrs().find (sp);
-
+
if (x != sptrs().end()) {
sptrs().erase (x);
if (debug_out) {
@@ -214,11 +214,11 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int
newpair.second = new SPDebug (new Backtrace());
sptrs().insert (newpair);
-
+
if (debug_out) {
cerr << "assignment created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count
<< " UC = " << new_use_count
- << " (total sp's = " << sptrs().size() << ')' << endl;
+ << " (total sp's = " << sptrs().size() << ')' << endl;
cerr << *newpair.second << endl;
}
}
@@ -242,10 +242,10 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c
if (is_interesting_object (old_obj)) {
if (debug_out) {
cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count
- << " (total sp's = " << sptrs().size() << ')' << endl;
+ << " (total sp's = " << sptrs().size() << ')' << endl;
}
PointerMap::iterator x = sptrs().find (sp);
-
+
if (x != sptrs().end()) {
sptrs().erase (x);
if (debug_out) {
@@ -262,11 +262,11 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c
newpair.second = new SPDebug (new Backtrace());
sptrs().insert (newpair);
-
+
if (debug_out) {
cerr << "reset created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count
<< " UC = " << new_use_count
- << " (total sp's = " << sptrs().size() << ')' << endl;
+ << " (total sp's = " << sptrs().size() << ')' << endl;
cerr << *newpair.second << endl;
}
}
diff --git a/libs/pbd/controllable_descriptor.cc b/libs/pbd/controllable_descriptor.cc
index c3c0752c84..0228d004e4 100644
--- a/libs/pbd/controllable_descriptor.cc
+++ b/libs/pbd/controllable_descriptor.cc
@@ -35,14 +35,14 @@ ControllableDescriptor::set (const std::string& str)
string front = str.substr (0, first_space);
string back = str.substr (first_space);
- vector<string> path;
+ vector<string> path;
split (front, path, '/');
if (path.size() < 2) {
return -1;
}
- vector<string> rest;
+ vector<string> rest;
split (back, rest, ' ');
if (rest.size() < 1) {
@@ -106,7 +106,7 @@ ControllableDescriptor::set (const std::string& str)
return -1;
}
} else if (path[1] == "send") {
-
+
if (path.size() == 3 && rest.size() == 2) {
if (path[2] == "gain") {
_subtype = SendGain;
@@ -118,7 +118,7 @@ ControllableDescriptor::set (const std::string& str)
return -1;
}
}
-
+
return 0;
}
@@ -127,7 +127,7 @@ ControllableDescriptor::rid() const
{
if (banked()) {
return _rid + _bank_offset;
- }
+ }
return _rid;
}
@@ -138,6 +138,6 @@ ControllableDescriptor::target (uint32_t n) const
if (n < _target.size()) {
return _target[n];
}
-
+
return 0;
}
diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc
index 8653b504e9..660891076d 100644
--- a/libs/pbd/convert.cc
+++ b/libs/pbd/convert.cc
@@ -132,7 +132,7 @@ short_version (string orig, string::size_type target_length)
}
/* whatever the length is now, use it */
-
+
return orig;
}
@@ -187,9 +187,9 @@ int_from_hex (char hic, char loc)
} else if( ('A'<=hi) && (hi<='F') ) {
hi -= ('A'-10);
}
-
+
lo = (int) loc;
-
+
if( ('0'<=lo) && (lo<='9') ) {
lo -= '0';
} else if( ('a'<=lo) && (lo<='f') ) {
@@ -249,14 +249,14 @@ length2string (const int64_t frames, const double sample_rate)
secs -= (hrs * 3600LL);
int64_t mins = secs / 60LL;
secs -= (mins * 60LL);
-
+
int64_t total_secs = (hrs * 3600LL) + (mins * 60LL) + secs;
int64_t frames_remaining = (int64_t) floor (frames - (total_secs * sample_rate));
float fractional_secs = (float) frames_remaining / sample_rate;
-
+
char duration_str[64];
sprintf (duration_str, "%02" PRIi64 ":%02" PRIi64 ":%05.2f", hrs, mins, (float) secs + fractional_secs);
-
+
return duration_str;
}
diff --git a/libs/pbd/crossthread.posix.cc b/libs/pbd/crossthread.posix.cc
index 5e743ba557..e3f6df5a31 100644
--- a/libs/pbd/crossthread.posix.cc
+++ b/libs/pbd/crossthread.posix.cc
@@ -16,7 +16,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
error << "cannot set non-blocking mode for x-thread pipe (read) (" << ::strerror (errno) << ')' << endmsg;
return;
}
-
+
if (fcntl (fds[1], F_SETFL, O_NONBLOCK)) {
error << "cannot set non-blocking mode for x-thread pipe (write) (%2)" << ::strerror (errno) << ')' << endmsg;
return;
diff --git a/libs/pbd/crossthread.win.cc b/libs/pbd/crossthread.win.cc
index 69d744e81d..5eca5fb4e8 100644
--- a/libs/pbd/crossthread.win.cc
+++ b/libs/pbd/crossthread.win.cc
@@ -43,7 +43,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
// make the socket non-blockable if required
u_long mode = (u_long)non_blocking;
int otp_result = 0;
-
+
otp_result = ioctlsocket(send_socket, FIONBIO, &mode);
if (otp_result != NO_ERROR) {
std::cerr << "CrossThreadChannel::CrossThreadChannel() Send socket cannot be set to non blocking mode with error: " << WSAGetLastError() << std::endl;
@@ -72,10 +72,10 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
std::cerr << "CrossThreadChannel::CrossThreadChannel() Setting receive socket address to local failed with error: " << WSAGetLastError() << std::endl;
return;
}
-
+
// construct IOChannel
receive_channel = g_io_channel_win32_new_socket((gint)receive_socket);
-
+
// set binary data type
GIOStatus g_status = g_io_channel_set_encoding (receive_channel, NULL, NULL);
if (G_IO_STATUS_NORMAL != g_status ) {
@@ -104,7 +104,7 @@ CrossThreadChannel::wakeup ()
{
char c = 0;
- // write one byte to wake up a thread which is listening our IOS
+ // write one byte to wake up a thread which is listening our IOS
sendto(send_socket, &c, sizeof(c), 0, (SOCKADDR*)&recv_address, sizeof(recv_address) );
}
@@ -125,7 +125,7 @@ CrossThreadChannel::drain ()
if (G_IO_STATUS_NORMAL != g_status) {
std::cerr << "CrossThreadChannel::CrossThreadChannel() Cannot drain from read buffer! " << g_status << std::endl;
-
+
if (g_error) {
std::cerr << "Error is Domain: " << g_error->domain << " Code: " << g_error->code << std::endl;
g_clear_error(&g_error);
@@ -184,7 +184,7 @@ CrossThreadChannel::receive (char& msg, bool wait)
return -1;
}
}
-
+
// fetch the message from the channel.
GIOStatus g_status = g_io_channel_read_chars (receive_channel, &msg, sizeof(msg), &read, &g_error);
diff --git a/libs/pbd/debug.cc b/libs/pbd/debug.cc
index 8ceea3f1af..af8cd052cd 100644
--- a/libs/pbd/debug.cc
+++ b/libs/pbd/debug.cc
@@ -115,9 +115,9 @@ PBD::parse_debug_options (const char* str)
}
}
}
-
+
debug_bits = bits;
-
+
return 0;
}
diff --git a/libs/pbd/enumwriter.cc b/libs/pbd/enumwriter.cc
index 50507972c2..ddc8215194 100644
--- a/libs/pbd/enumwriter.cc
+++ b/libs/pbd/enumwriter.cc
@@ -41,7 +41,7 @@ nocase_cmp(const string & s1, const string& s2)
{
string::const_iterator it1 = s1.begin();
string::const_iterator it2 = s2.begin();
-
+
while ((it1 != s1.end()) && (it2 != s2.end())) {
if(::toupper(*it1) != ::toupper(*it2)) {//letters differ?
// return -1 to indicate 'smaller than', 1 otherwise
@@ -97,7 +97,7 @@ EnumWriter::register_distinct (string type, vector<int> v, vector<string> s)
newpair.first = type;
newpair.second = EnumRegistration (v, s, false);
-
+
result = registry.insert (newpair);
if (!result.second) {
@@ -113,7 +113,7 @@ EnumWriter::register_bits (string type, vector<int> v, vector<string> s)
newpair.first = type;
newpair.second = EnumRegistration (v, s, true);
-
+
result = registry.insert (newpair);
if (!result.second) {
@@ -153,7 +153,7 @@ EnumWriter::read (string type, string value)
} else {
return read_distinct (x->second, value);
}
-}
+}
string
EnumWriter::write_bits (EnumRegistration& er, int value)
@@ -263,7 +263,7 @@ EnumWriter::read_bits (EnumRegistration& er, string str)
}
do {
-
+
comma = str.find_first_of (',');
string segment = str.substr (0, comma);
diff --git a/libs/pbd/epa.cc b/libs/pbd/epa.cc
index cfc5692138..4af2029308 100644
--- a/libs/pbd/epa.cc
+++ b/libs/pbd/epa.cc
@@ -144,12 +144,12 @@ EnvironmentalProtectionAgency::clear () const
for (vector<string>::const_iterator e = ecopy.begin(); e != ecopy.end(); ++e) {
string::size_type equal = (*e).find_first_of ('=');
-
+
if (equal == string::npos) {
/* say what? an environ value without = ? */
continue;
}
-
+
string var_name = (*e).substr (0, equal);
g_unsetenv(var_name.c_str());
}
diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc
index 6506c18be9..d3f2fe5038 100644
--- a/libs/pbd/event_loop.cc
+++ b/libs/pbd/event_loop.cc
@@ -66,7 +66,7 @@ EventLoop::invalidate_request (void* data)
* want, and many of the objects we want to do this with already
* inherit (indirectly) from sigc::trackable.
*/
-
+
if (ir->event_loop) {
Glib::Threads::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
for (list<BaseRequestObject*>::iterator i = ir->requests.begin(); i != ir->requests.end(); ++i) {
diff --git a/libs/pbd/ffs.cc b/libs/pbd/ffs.cc
index 48a417c4f5..1ca913c54c 100644
--- a/libs/pbd/ffs.cc
+++ b/libs/pbd/ffs.cc
@@ -31,7 +31,7 @@ ffs (int x)
return __builtin_ffs(x);
#elif defined (COMPILER_MSVC)
unsigned long index;
-#ifdef WIN64
+#ifdef WIN64
if (0 != _BitScanForward64(&index, (__int64)x))
#else
if (0 != _BitScanForward(&index, (unsigned long)x))
diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc
index 7812ad6696..9838b4565b 100644
--- a/libs/pbd/fpu.cc
+++ b/libs/pbd/fpu.cc
@@ -172,9 +172,9 @@ FPU::FPU ()
info << string_compose (_("CPU vendor: %1"), cpu_vendor) << endmsg;
if (num_ids > 0) {
-
+
/* Now get CPU/FPU flags */
-
+
__cpuid (cpu_info, 1);
if ((cpu_info[2] & (1<<27)) /* OSXSAVE */ &&
@@ -193,11 +193,11 @@ FPU::FPU ()
}
/* Figure out CPU/FPU denormal handling capabilities */
-
+
if (cpu_info[3] & (1 << 24)) {
-
+
char** fxbuf = 0;
-
+
/* DAZ wasn't available in the first version of SSE. Since
setting a reserved bit in MXCSR causes a general protection
fault, we need to be able to check the availability of this
@@ -226,10 +226,10 @@ FPU::FPU ()
assert (fxbuf);
(void) posix_memalign ((void **) fxbuf, 16, 512);
assert (*fxbuf);
-#endif
-
+#endif
+
memset (*fxbuf, 0, 512);
-
+
#ifdef COMPILER_MSVC
char *buf = *fxbuf;
__asm {
@@ -244,19 +244,19 @@ FPU::FPU ()
: "memory"
);
#endif
-
+
uint32_t mxcsr_mask = *((uint32_t*) &((*fxbuf)[28]));
-
+
/* if the mask is zero, set its default value (from intel specs) */
-
+
if (mxcsr_mask == 0) {
mxcsr_mask = 0xffbf;
}
-
+
if (mxcsr_mask & (1<<6)) {
_flags = Flags (_flags | HasDenormalsAreZero);
}
-
+
#if !defined HAVE_POSIX_MEMALIGN && defined PLATFORM_WINDOWS
_aligned_free (*fxbuf);
_aligned_free (fxbuf);
@@ -272,10 +272,10 @@ FPU::FPU ()
const int parameter_end = 0x80000004;
string cpu_brand;
-
+
if (cpu_info[0] >= parameter_end) {
char* cpu_string_ptr = cpu_string;
-
+
for (int parameter = 0x80000002; parameter <= parameter_end &&
cpu_string_ptr < &cpu_string[sizeof(cpu_string)]; parameter++) {
__cpuid(cpu_info, parameter);
@@ -287,7 +287,7 @@ FPU::FPU ()
}
}
#endif /* !ARCH_X86 */
-}
+}
FPU::~FPU ()
{
diff --git a/libs/pbd/id.cc b/libs/pbd/id.cc
index c9823f0dc8..9a610c7418 100644
--- a/libs/pbd/id.cc
+++ b/libs/pbd/id.cc
@@ -61,7 +61,7 @@ ID::reset ()
{
Glib::Threads::Mutex::Lock lm (*counter_lock);
_id = _counter++;
-}
+}
int
ID::string_assign (string str)
diff --git a/libs/pbd/malign.cc b/libs/pbd/malign.cc
index 14fa9ea66c..c48544d160 100644
--- a/libs/pbd/malign.cc
+++ b/libs/pbd/malign.cc
@@ -62,7 +62,7 @@ int cache_aligned_malloc (void** memptr, size_t size)
}
return 0;
-#endif
+#endif
}
void cache_aligned_free (void* memptr)
@@ -101,7 +101,7 @@ int aligned_malloc (void** memptr, size_t size, size_t alignment)
}
return 0;
-#endif
+#endif
}
void aligned_free (void* memptr)
diff --git a/libs/pbd/md5.cc b/libs/pbd/md5.cc
index 2fd7ab11da..ae3631bfd2 100644
--- a/libs/pbd/md5.cc
+++ b/libs/pbd/md5.cc
@@ -182,7 +182,7 @@ char*
MD5::digestFile (char *filename)
{
Init();
-
+
FILE *file;
int len;
unsigned char buffer[1024];
@@ -226,9 +226,9 @@ void
MD5::Transform (uint32_t state[4], uint8_t const * block)
{
uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
-
+
Decode (x, block, 64);
-
+
/* Round 1 */
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
@@ -246,7 +246,7 @@ MD5::Transform (uint32_t state[4], uint8_t const * block)
FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
-
+
/* Round 2 */
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
@@ -264,7 +264,7 @@ MD5::Transform (uint32_t state[4], uint8_t const * block)
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
-
+
/* Round 3 */
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
@@ -334,7 +334,7 @@ void
MD5::Decode (uint32_t *output, uint8_t const * input, size_t len)
{
size_t i, j;
-
+
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
(((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
diff --git a/libs/pbd/mountpoint.cc b/libs/pbd/mountpoint.cc
index 4867d3675c..82aaadb9eb 100644
--- a/libs/pbd/mountpoint.cc
+++ b/libs/pbd/mountpoint.cc
@@ -50,7 +50,7 @@ mountpoint (string path)
unsigned int matchlen;
const char *cpath = path.c_str();
char best[PATH_MAX+1];
-
+
if ((mntf = setmntent ("/etc/mtab", "r")) == 0) {
return "";
}
@@ -122,10 +122,10 @@ mountpoint (string path)
unsigned int matchlen;
const char *cpath = path.c_str();
char best[PATH_MAX+1];
-
+
/* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the
application."
-
+
Thus: we do NOT try to free memory allocated by getmntinfo()
*/
@@ -163,13 +163,13 @@ mountpoint (string path)
}
}
}
-
+
return best;
}
#endif // HAVE_GETMNTENT
#ifdef TEST_MOUNTPOINT
-
+
main (int argc, char *argv[])
{
printf ("mp of %s = %s\n", argv[1], mountpoint (argv[1]).c_str());
diff --git a/libs/pbd/msvc/getopt_long.c b/libs/pbd/msvc/getopt_long.c
index bf10e5df58..609d0ef5f4 100644
--- a/libs/pbd/msvc/getopt_long.c
+++ b/libs/pbd/msvc/getopt_long.c
@@ -152,7 +152,7 @@ gcd(int a, int b)
b = c;
c = a % b;
}
-
+
return b;
}
@@ -435,7 +435,7 @@ getopt_long(int nargc,
has_equal++;
} else
current_argv_len = strlen(current_argv);
-
+
for (i = 0; long_options[i].name; i++) {
/* find matching long option */
if (strncmp(current_argv, long_options[i].name,
diff --git a/libs/pbd/pathexpand.cc b/libs/pbd/pathexpand.cc
index 805e0b85cd..a92005a086 100644
--- a/libs/pbd/pathexpand.cc
+++ b/libs/pbd/pathexpand.cc
@@ -69,7 +69,7 @@ realpath (const char *original_path, char resolved_path[_MAX_PATH+1])
// possibly need to add that functionality here at a later date.
} else {
char temp[(_MAX_PATH+1)*6]; // Allow for maximum length of a path in wchar characters
-
+
// POSIX 'realpath()' requires that the buffer size is at
// least PATH_MAX+1, so assume that the user knew this !!
@@ -78,9 +78,9 @@ realpath (const char *original_path, char resolved_path[_MAX_PATH+1])
if (0 != rpath) {
snprintf (resolved_path, _MAX_PATH+1, "%s", Glib::locale_to_utf8 (temp).c_str());
}
-
+
}
-
+
return (rpath);
}
@@ -129,7 +129,7 @@ PBD::path_expand (string path)
regex_t compiled_pattern;
const int nmatches = 100;
regmatch_t matches[nmatches];
-
+
if (regcomp (&compiled_pattern, "\\$([a-zA-Z_][a-zA-Z0-9_]*|\\{[a-zA-Z_][a-zA-Z0-9_]*\\})", REG_EXTENDED)) {
std::cerr << "bad regcomp\n";
return path;
@@ -140,11 +140,11 @@ PBD::path_expand (string path)
if (regexec (&compiled_pattern, path.c_str(), nmatches, matches, 0)) {
break;
}
-
+
/* matches[0] gives the entire match */
-
+
string match = path.substr (matches[0].rm_so, matches[0].rm_eo - matches[0].rm_so);
-
+
/* try to get match from the environment */
if (match[1] == '{') {
diff --git a/libs/pbd/pbd.cc b/libs/pbd/pbd.cc
index 229dc04f32..13383c27d1 100644
--- a/libs/pbd/pbd.cc
+++ b/libs/pbd/pbd.cc
@@ -101,7 +101,7 @@ PBD::init ()
/* Initialize windows socket DLL for PBD::CrossThreadChannel
*/
-
+
if (WSAStartup(MAKEWORD(1,1),&wsaData) != 0) {
fatal << X_("Windows socket initialization failed with error: ") << WSAGetLastError() << endmsg;
abort();
@@ -141,7 +141,7 @@ PBD::cleanup ()
#ifdef PLATFORM_WINDOWS
PBD::MMCSS::deinitialize ();
WSACleanup();
-#endif
+#endif
EnumWriter::destroy ();
FPU::destroy ();
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc
index d2f8840b90..323435bdd9 100644
--- a/libs/pbd/pbd/abstract_ui.cc
+++ b/libs/pbd/pbd/abstract_ui.cc
@@ -43,7 +43,7 @@ template<typename RequestBuffer> void
cleanup_request_buffer (void* ptr)
{
RequestBuffer* rb = (RequestBuffer*) ptr;
-
+
/* this is called when the thread for which this request buffer was
* allocated dies. That could be before or after the end of the UI
* event loop for which this request buffer provides communication.
@@ -54,7 +54,7 @@ cleanup_request_buffer (void* ptr)
* a request. If the UI has finished processing requests, then
* we will leak this buffer object.
*/
-
+
rb->dead = true;
}
@@ -127,7 +127,7 @@ AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_
when the thread exits, and ensures that the buffer is marked
dead. it will then be deleted during a call to handle_ui_requests()
*/
-
+
per_thread_request_buffer.set (b);
}
@@ -229,7 +229,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
++tmp;
request_buffers.erase (i);
i = tmp;
- } else {
+ } else {
++i;
}
}
@@ -264,7 +264,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
if (req->invalidation) {
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 remove request from its invalidation list\n", name(), pthread_name()));
-
+
/* after this call, if the object referenced by the
* invalidation record is deleted, it will no longer
* try to mark the request as invalid.
@@ -283,7 +283,7 @@ AbstractUI<RequestObject>::handle_ui_requests ()
*/
request_buffer_map_lock.unlock ();
-
+
/* unlock the request lock while we execute the request, so
* that we don't needlessly block other threads (note: not RT
* threads since they have their own queue) from making requests.
@@ -328,7 +328,7 @@ AbstractUI<RequestObject>::send_request (RequestObject *req)
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 direct dispatch of request type %3\n", name(), pthread_name(), req->type));
do_request (req);
delete req;
- } else {
+ } else {
/* If called from a different thread, we first check to see if
* the calling thread is registered with this UI. If so, there
@@ -374,7 +374,7 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo
}
RequestObject *req = get_request (BaseUI::CallSlot);
-
+
if (req == 0) {
return;
}
@@ -384,7 +384,7 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo
/* copy semantics: copy the functor into the request object */
req->the_slot = f;
-
+
/* the invalidation record is an object which will carry out
* invalidation of any requests associated with it when it is
* destroyed. it can be null. if its not null, associate this
@@ -401,5 +401,5 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo
}
send_request (req);
-}
+}
diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h
index 060d05d37f..5491210db7 100644
--- a/libs/pbd/pbd/abstract_ui.h
+++ b/libs/pbd/pbd/abstract_ui.h
@@ -92,10 +92,10 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI
RequestBufferMap request_buffers;
static Glib::Threads::Private<RequestBuffer> per_thread_request_buffer;
-
+
Glib::Threads::Mutex request_list_lock;
std::list<RequestObject*> request_list;
-
+
RequestObject* get_request (RequestType);
void handle_ui_requests ();
void send_request (RequestObject *);
diff --git a/libs/pbd/pbd/atomic_counter.h b/libs/pbd/pbd/atomic_counter.h
index 019ff857f4..4b8c2e857a 100644
--- a/libs/pbd/pbd/atomic_counter.h
+++ b/libs/pbd/pbd/atomic_counter.h
@@ -63,7 +63,7 @@ public:
{
return g_atomic_int_dec_and_test (&m_value);
}
-
+
bool operator-- ()
{
return decrement_and_test ();
diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h
index eddaf862c5..ec2cf33678 100644
--- a/libs/pbd/pbd/base_ui.h
+++ b/libs/pbd/pbd/base_ui.h
@@ -57,7 +57,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop
std::string name() const { return _name; }
bool ok() const { return _ok; }
-
+
static RequestType new_request_type();
static RequestType CallSlot;
static RequestType Quit;
diff --git a/libs/pbd/pbd/command.h b/libs/pbd/pbd/command.h
index 9feac6366a..337140e786 100644
--- a/libs/pbd/pbd/command.h
+++ b/libs/pbd/pbd/command.h
@@ -34,13 +34,13 @@ public:
virtual ~Command() { /* NOTE: derived classes must call drop_references() */ }
virtual void operator() () = 0;
-
+
void set_name (const std::string& str) { _name = str; }
const std::string& name() const { return _name; }
virtual void undo() = 0;
virtual void redo() { (*this)(); }
-
+
virtual XMLNode &get_state();
virtual int set_state(const XMLNode&, int /*version*/) { /* noop */ return 0; }
diff --git a/libs/pbd/pbd/compose.h b/libs/pbd/pbd/compose.h
index 768820b61a..231afa583e 100644
--- a/libs/pbd/pbd/compose.h
+++ b/libs/pbd/pbd/compose.h
@@ -174,7 +174,7 @@ namespace StringPrivate
}
++arg_no;
-
+
return *this;
}
@@ -194,7 +194,7 @@ namespace StringPrivate
else if (is_number(fmt[i + 1])) { // aha! a spec!
// save string
output.push_back(fmt.substr(b, i - b));
-
+
int n = 1; // number of digits
int spec_no = 0;
@@ -207,9 +207,9 @@ namespace StringPrivate
spec_no /= 10;
output_list::iterator pos = output.end();
--pos; // safe since we have just inserted a string>
-
+
specs.insert(specification_map::value_type(spec_no, pos));
-
+
// jump over spec string
i += n;
b = i;
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
index 257fe8dcab..235c4ce904 100644
--- a/libs/pbd/pbd/controllable.h
+++ b/libs/pbd/pbd/controllable.h
@@ -90,7 +90,7 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible {
static PBD::Signal1<void,PBD::Controllable*> StopLearning;
static PBD::Signal1<void,Controllable*> Destroyed;
-
+
PBD::Signal0<void> Changed;
int set_state (const XMLNode&, int version);
diff --git a/libs/pbd/pbd/crossthread.h b/libs/pbd/pbd/crossthread.h
index d9b80db48c..e87879e4a3 100644
--- a/libs/pbd/pbd/crossthread.h
+++ b/libs/pbd/pbd/crossthread.h
@@ -50,11 +50,11 @@ public:
*/
CrossThreadChannel(bool non_blocking);
~CrossThreadChannel();
-
+
/** Tell the listening thread that is has work to do.
*/
void wakeup();
-
+
/* if the listening thread cares about the precise message
* it is being sent, then ::deliver() can be used to send
* a single byte message rather than a simple wakeup. These
diff --git a/libs/pbd/pbd/debug_rt_alloc.h b/libs/pbd/pbd/debug_rt_alloc.h
index 0d1b4bd47c..43f62bd7da 100644
--- a/libs/pbd/pbd/debug_rt_alloc.h
+++ b/libs/pbd/pbd/debug_rt_alloc.h
@@ -34,7 +34,7 @@ LIBPBD_API extern int (*pbd_alloc_allowed) ();
/** Call this to suspend malloc checking until a call to resume_rt_malloc_checks */
LIBPBD_API extern void suspend_rt_malloc_checks ();
-/** Resume malloc checking after a suspension */
+/** Resume malloc checking after a suspension */
LIBPBD_API extern void resume_rt_malloc_checks ();
}
diff --git a/libs/pbd/pbd/destructible.h b/libs/pbd/pbd/destructible.h
index 0c401a947f..261697cafa 100644
--- a/libs/pbd/pbd/destructible.h
+++ b/libs/pbd/pbd/destructible.h
@@ -29,7 +29,7 @@ class LIBPBD_API Destructible {
public:
Destructible() {}
virtual ~Destructible () { Destroyed(); }
-
+
PBD::Signal0<void> Destroyed;
PBD::Signal0<void> DropReferences;
diff --git a/libs/pbd/pbd/enumwriter.h b/libs/pbd/pbd/enumwriter.h
index 405a187817..6f2333277d 100644
--- a/libs/pbd/pbd/enumwriter.h
+++ b/libs/pbd/pbd/enumwriter.h
@@ -40,7 +40,7 @@ class LIBPBD_API unknown_enumeration : public std::exception {
}
~unknown_enumeration () throw() {}
-
+
virtual const char *what() const throw() {
return _message.c_str();
}
diff --git a/libs/pbd/pbd/epa.h b/libs/pbd/pbd/epa.h
index 89c085a5bc..8727fad08e 100644
--- a/libs/pbd/pbd/epa.h
+++ b/libs/pbd/pbd/epa.h
@@ -41,7 +41,7 @@ class LIBPBD_API EnvironmentalProtectionAgency {
private:
void clear () const;
-
+
bool _armed;
std::string _envname;
std::map<std::string,std::string> e;
diff --git a/libs/pbd/pbd/fastlog.h b/libs/pbd/pbd/fastlog.h
index 21cbfbdce2..80b02e9522 100644
--- a/libs/pbd/pbd/fastlog.h
+++ b/libs/pbd/pbd/fastlog.h
@@ -25,9 +25,9 @@ static inline float fast_log2 (float val)
x &= ~(255 << 23);
x += 127 << 23;
*exp_ptr = x;
-
+
val = ((-1.0f/3) * t.f + 2) * t.f - 2.0f/3;
-
+
return (val + log_2);
}
diff --git a/libs/pbd/pbd/fpu.h b/libs/pbd/pbd/fpu.h
index 8be9e1a35b..045b633812 100644
--- a/libs/pbd/pbd/fpu.h
+++ b/libs/pbd/pbd/fpu.h
@@ -39,13 +39,13 @@ class LIBPBD_API FPU {
static FPU* instance();
static void destroy();
-
+
bool has_flush_to_zero () const { return _flags & HasFlushToZero; }
bool has_denormals_are_zero () const { return _flags & HasDenormalsAreZero; }
bool has_sse () const { return _flags & HasSSE; }
bool has_sse2 () const { return _flags & HasSSE2; }
bool has_avx () const { return _flags & HasAVX; }
-
+
private:
Flags _flags;
diff --git a/libs/pbd/pbd/functor_command.h b/libs/pbd/pbd/functor_command.h
index 68092a77bb..9fc35ee138 100644
--- a/libs/pbd/pbd/functor_command.h
+++ b/libs/pbd/pbd/functor_command.h
@@ -71,7 +71,7 @@ class /*LIBPBD_API*/ FunctorCommand : public Command
virtual XMLNode &get_state() {
std::stringstream ss;
-
+
XMLNode *node = new XMLNode("FunctorCommand");
node->add_property("type_name", typeid(obj_type).name());
node->add_property("functor", functor_name);
diff --git a/libs/pbd/pbd/id.h b/libs/pbd/pbd/id.h
index 05ac69e26d..1f33e6d732 100644
--- a/libs/pbd/pbd/id.h
+++ b/libs/pbd/pbd/id.h
@@ -56,7 +56,7 @@ class LIBPBD_API ID {
void print (char* buf, uint32_t bufsize) const;
std::string to_s() const;
-
+
static uint64_t counter() { return _counter; }
static void init_counter (uint64_t val) { _counter = val; }
static void init ();
diff --git a/libs/pbd/pbd/md5.h b/libs/pbd/pbd/md5.h
index 8a5ee71aab..a02013eb72 100644
--- a/libs/pbd/pbd/md5.h
+++ b/libs/pbd/pbd/md5.h
@@ -32,14 +32,14 @@ class LIBPBD_API MD5
{
public:
MD5();
-
+
// an MD5 digest is a 16-byte number (32 hex digits)
uint8_t digestRaw[16] ;
-
+
// This version of the digest is actually
// a "printf'd" version of the digest.
char digestChars[33] ;
-
+
void writeToString ();
char* digestFile (char *filename);
char* digestMemory (uint8_t const * memchunk, size_t len);
@@ -53,14 +53,14 @@ class LIBPBD_API MD5
};
context_t context;
-
+
void Init ();
void Transform (uint32_t state[4], uint8_t const * block);
void Encode (uint8_t *output, uint32_t const *input, size_t len);
void Decode (uint32_t *output, uint8_t const * input, size_t len);
void Update (uint8_t const *input, size_t inputLen);
void Final ();
-
+
};
#endif /* __libpbd_md5_h__ */
diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h
index 437f58631d..b6e0bc9cf3 100644
--- a/libs/pbd/pbd/memento_command.h
+++ b/libs/pbd/pbd/memento_command.h
@@ -84,7 +84,7 @@ public:
void add_state (XMLNode* node) {
node->add_property ("obj_id", _object.id().to_s());
}
-
+
void object_died () {
/* The object we are binding died, so drop references to ourselves */
this->drop_references ();
@@ -116,7 +116,7 @@ public:
/* The binder's object died, so we must die */
_binder->DropReferences.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_dying, this));
}
-
+
~MementoCommand () {
drop_references ();
delete before;
@@ -152,13 +152,13 @@ public:
XMLNode* node = new XMLNode(name);
_binder->add_state (node);
-
+
node->add_property ("type_name", _binder->type_name ());
if (before) {
node->add_child_copy(*before);
}
-
+
if (after) {
node->add_child_copy(*after);
}
diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h
index 8aff60fb6a..edc247332e 100644
--- a/libs/pbd/pbd/pool.h
+++ b/libs/pbd/pbd/pool.h
@@ -39,12 +39,12 @@ class LIBPBD_API Pool
virtual void *alloc ();
virtual void release (void *);
-
+
std::string name() const { return _name; }
guint available() const { return free_list.read_space(); }
guint used() const { return free_list.bufsize() - available(); }
guint total() const { return free_list.bufsize(); }
-
+
protected:
RingBuffer<void*> free_list; ///< a list of pointers to free items within block
std::string _name;
diff --git a/libs/pbd/pbd/properties.h b/libs/pbd/pbd/properties.h
index f67fe50413..0ba42b8e55 100644
--- a/libs/pbd/pbd/properties.h
+++ b/libs/pbd/pbd/properties.h
@@ -99,7 +99,7 @@ public:
/* MANAGEMENT OF Stateful State */
-
+
bool set_value (XMLNode const & node) {
XMLProperty const* p = node.property (property_name());
@@ -120,9 +120,9 @@ public:
node.add_property (property_name(), to_string (_current));
}
-
+
/* MANAGEMENT OF HISTORY */
-
+
void clear_changes () {
_have_old = false;
}
@@ -137,7 +137,7 @@ public:
/* TRANSFERRING HISTORY TO / FROM A StatefulDiffCommand */
-
+
void get_changes_as_xml (XMLNode* history_node) const {
XMLNode* node = history_node->add_child (property_name());
node->add_property ("from", to_string (_old));
@@ -225,7 +225,7 @@ public:
Property<T>* clone () const {
return new Property<T> (this->property_id(), this->_old, this->_current);
}
-
+
Property<T>* clone_from_xml (const XMLNode& node) const {
XMLNodeList const & children = node.children ();
XMLNodeList::const_iterator i = children.begin();
@@ -238,11 +238,11 @@ public:
}
XMLProperty* from = (*i)->property ("from");
XMLProperty* to = (*i)->property ("to");
-
+
if (!from || !to) {
return 0;
}
-
+
return new Property<T> (this->property_id(), from_string (from->value()), from_string (to->value ()));
}
@@ -295,7 +295,7 @@ public:
Property (PropertyDescriptor<std::string> d, std::string const & o, std::string const & c)
: PropertyTemplate<std::string> (d, o, c)
{}
-
+
Property<std::string>* clone () const {
return new Property<std::string> (this->property_id(), _old, _current);
}
@@ -356,12 +356,12 @@ class /*LIBPBD_API*/ SharedStatefulProperty : public PropertyBase
{
public:
typedef boost::shared_ptr<T> Ptr;
-
+
SharedStatefulProperty (PropertyID d, Ptr p)
: PropertyBase (d)
, _current (p)
{
-
+
}
SharedStatefulProperty (PropertyID d, Ptr o, Ptr c)
@@ -369,7 +369,7 @@ public:
, _old (o)
, _current (c)
{
-
+
}
bool set_value (XMLNode const & node) {
diff --git a/libs/pbd/pbd/property_basics.h b/libs/pbd/pbd/property_basics.h
index c4e4549ecd..88f94fe211 100644
--- a/libs/pbd/pbd/property_basics.h
+++ b/libs/pbd/pbd/property_basics.h
@@ -32,7 +32,7 @@ class Command;
namespace PBD {
class LIBPBD_API PropertyList;
-class LIBPBD_API StatefulDiffCommand;
+class LIBPBD_API StatefulDiffCommand;
/** A unique identifier for a property of a Stateful object */
typedef GQuark PropertyID;
@@ -41,7 +41,7 @@ template<typename T>
struct LIBPBD_TEMPLATE_API PropertyDescriptor {
PropertyDescriptor () : property_id (0) {}
PropertyDescriptor (PropertyID pid) : property_id (pid) {}
-
+
PropertyID property_id;
typedef T value_type;
};
@@ -121,7 +121,7 @@ public:
/** Invert the changes in this property */
virtual void invert () = 0;
-
+
/* TRANSFERRING HISTORY TO / FROM A StatefulDiffCommand */
@@ -129,7 +129,7 @@ public:
* StatefulDiffCommand node.
*/
virtual void get_changes_as_xml (XMLNode *) const = 0;
-
+
/** If this Property has changed, clone it and add it to a given list.
* Used for making StatefulDiffCommands.
*/
@@ -145,7 +145,7 @@ public:
/* VARIOUS */
-
+
virtual PropertyBase* clone () const = 0;
/** Set this property's current state from another */
@@ -158,12 +158,12 @@ public:
return _property_id == pid;
}
-protected:
+protected:
/* copy construction only by subclasses */
PropertyBase (PropertyBase const & b)
: _property_id (b._property_id)
{}
-
+
private:
PropertyID _property_id;
diff --git a/libs/pbd/pbd/property_list.h b/libs/pbd/pbd/property_list.h
index 28b60b521e..9373d2c281 100644
--- a/libs/pbd/pbd/property_list.h
+++ b/libs/pbd/pbd/property_list.h
@@ -29,7 +29,7 @@ class XMLNode;
namespace PBD {
-/** A list of properties, mapped using their ID */
+/** A list of properties, mapped using their ID */
class LIBPBD_API PropertyList : public std::map<PropertyID, PropertyBase*>
{
public:
diff --git a/libs/pbd/pbd/receiver.h b/libs/pbd/pbd/receiver.h
index 2919063cbe..e7f3f25b0b 100644
--- a/libs/pbd/pbd/receiver.h
+++ b/libs/pbd/pbd/receiver.h
@@ -34,7 +34,7 @@ class LIBPBD_API Receiver : public sigc::trackable
public:
Receiver ();
virtual ~Receiver ();
-
+
void listen_to (Transmitter &);
void hangup ();
diff --git a/libs/pbd/pbd/ringbuffer.h b/libs/pbd/pbd/ringbuffer.h
index 935beb0469..58c463ecbe 100644
--- a/libs/pbd/pbd/ringbuffer.h
+++ b/libs/pbd/pbd/ringbuffer.h
@@ -39,7 +39,7 @@ class /*LIBPBD_API*/ RingBuffer
buf = new T[size];
reset ();
}
-
+
virtual ~RingBuffer() {
delete [] buf;
}
@@ -55,7 +55,7 @@ class /*LIBPBD_API*/ RingBuffer
g_atomic_int_set (&write_idx, w);
g_atomic_int_set (&read_idx, r);
}
-
+
guint read (T *dest, guint cnt);
guint write (T const * src, guint cnt);
@@ -66,7 +66,7 @@ class /*LIBPBD_API*/ RingBuffer
void get_read_vector (rw_vector *);
void get_write_vector (rw_vector *);
-
+
void decrement_read_idx (guint cnt) {
g_atomic_int_set (&read_idx, (g_atomic_int_get(&read_idx) - cnt) & size_mask);
}
@@ -81,10 +81,10 @@ class /*LIBPBD_API*/ RingBuffer
guint write_space () const {
guint w, r;
-
+
w = g_atomic_int_get (&write_idx);
r = g_atomic_int_get (&read_idx);
-
+
if (w > r) {
return ((r - w + size) & size_mask) - 1;
} else if (w < r) {
@@ -93,13 +93,13 @@ class /*LIBPBD_API*/ RingBuffer
return size - 1;
}
}
-
+
guint read_space () const {
guint w, r;
-
+
w = g_atomic_int_get (&write_idx);
r = g_atomic_int_get (&read_idx);
-
+
if (w > r) {
return w - r;
} else {
@@ -206,10 +206,10 @@ RingBuffer<T>::get_read_vector (typename RingBuffer<T>::rw_vector *vec)
guint free_cnt;
guint cnt2;
guint w, r;
-
+
w = g_atomic_int_get (&write_idx);
r = g_atomic_int_get (&read_idx);
-
+
if (w > r) {
free_cnt = w - r;
} else {
@@ -230,9 +230,9 @@ RingBuffer<T>::get_read_vector (typename RingBuffer<T>::rw_vector *vec)
vec->len[1] = cnt2 & size_mask;
} else {
-
+
/* Single part vector: just the rest of the buffer */
-
+
vec->buf[0] = &buf[r];
vec->len[0] = free_cnt;
vec->buf[1] = 0;
@@ -247,10 +247,10 @@ RingBuffer<T>::get_write_vector (typename RingBuffer<T>::rw_vector *vec)
guint free_cnt;
guint cnt2;
guint w, r;
-
+
w = g_atomic_int_get (&write_idx);
r = g_atomic_int_get (&read_idx);
-
+
if (w > r) {
free_cnt = ((r - w + size) & size_mask) - 1;
} else if (w < r) {
@@ -258,11 +258,11 @@ RingBuffer<T>::get_write_vector (typename RingBuffer<T>::rw_vector *vec)
} else {
free_cnt = size - 1;
}
-
+
cnt2 = w + free_cnt;
if (cnt2 > size) {
-
+
/* Two part vector: the rest of the buffer after the
current write ptr, plus some from the start of
the buffer.
diff --git a/libs/pbd/pbd/ringbufferNPT.h b/libs/pbd/pbd/ringbufferNPT.h
index e700e89d2e..f01a6f3a16 100644
--- a/libs/pbd/pbd/ringbufferNPT.h
+++ b/libs/pbd/pbd/ringbufferNPT.h
@@ -40,7 +40,7 @@ class /*LIBPBD_API*/ RingBufferNPT
buf = new T[size];
reset ();
}
-
+
virtual ~RingBufferNPT () {
delete [] buf;
}
@@ -56,7 +56,7 @@ class /*LIBPBD_API*/ RingBufferNPT
g_atomic_int_set (&write_ptr, w);
g_atomic_int_set (&read_ptr, r);
}
-
+
size_t read (T *dest, size_t cnt);
size_t write (const T *src, size_t cnt);
@@ -67,7 +67,7 @@ class /*LIBPBD_API*/ RingBufferNPT
void get_read_vector (rw_vector *);
void get_write_vector (rw_vector *);
-
+
void decrement_read_ptr (size_t cnt) {
g_atomic_int_set (&read_ptr, (g_atomic_int_get(&read_ptr) - cnt) % size);
}
@@ -82,10 +82,10 @@ class /*LIBPBD_API*/ RingBufferNPT
size_t write_space () {
size_t w, r;
-
+
w = g_atomic_int_get (&write_ptr);
r = g_atomic_int_get (&read_ptr);
-
+
if (w > r) {
return ((r - w + size) % size) - 1;
} else if (w < r) {
@@ -94,13 +94,13 @@ class /*LIBPBD_API*/ RingBufferNPT
return size - 1;
}
}
-
+
size_t read_space () {
size_t w, r;
-
+
w = g_atomic_int_get (&write_ptr);
r = g_atomic_int_get (&read_ptr);
-
+
if (w > r) {
return w - r;
} else {
@@ -204,10 +204,10 @@ RingBufferNPT<T>::get_read_vector (typename RingBufferNPT<T>::rw_vector *vec)
size_t free_cnt;
size_t cnt2;
size_t w, r;
-
+
w = g_atomic_int_get (&write_ptr);
r = g_atomic_int_get (&read_ptr);
-
+
if (w > r) {
free_cnt = w - r;
} else {
@@ -228,9 +228,9 @@ RingBufferNPT<T>::get_read_vector (typename RingBufferNPT<T>::rw_vector *vec)
vec->len[1] = cnt2 % size;
} else {
-
+
/* Single part vector: just the rest of the buffer */
-
+
vec->buf[0] = &buf[r];
vec->len[0] = free_cnt;
vec->buf[1] = 0;
@@ -244,10 +244,10 @@ RingBufferNPT<T>::get_write_vector (typename RingBufferNPT<T>::rw_vector *vec)
size_t free_cnt;
size_t cnt2;
size_t w, r;
-
+
w = g_atomic_int_get (&write_ptr);
r = g_atomic_int_get (&read_ptr);
-
+
if (w > r) {
free_cnt = ((r - w + size) % size) - 1;
} else if (w < r) {
@@ -255,11 +255,11 @@ RingBufferNPT<T>::get_write_vector (typename RingBufferNPT<T>::rw_vector *vec)
} else {
free_cnt = size - 1;
}
-
+
cnt2 = w + free_cnt;
if (cnt2 > size) {
-
+
/* Two part vector: the rest of the buffer after the
current write ptr, plus some from the start of
the buffer.
diff --git a/libs/pbd/pbd/search_path.h b/libs/pbd/pbd/search_path.h
index 9f0d407751..41b1ffee55 100644
--- a/libs/pbd/pbd/search_path.h
+++ b/libs/pbd/pbd/search_path.h
@@ -86,12 +86,12 @@ public:
* Add another directory path to the search path.
*/
LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const std::string& directory_path);
-
+
/**
* Concatenate another Searchpath onto this.
*/
LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const Searchpath& other);
-
+
/**
* Add another path to the search path.
*/
diff --git a/libs/pbd/pbd/selectable.h b/libs/pbd/pbd/selectable.h
index cb4677cba4..ac8f72aa0d 100644
--- a/libs/pbd/pbd/selectable.h
+++ b/libs/pbd/pbd/selectable.h
@@ -66,7 +66,7 @@ class LIBPBD_API Selectable : public sigc::trackable
fromPath,
fromFILE
};
-
+
bool _ok;
int _type;
std::string path;
@@ -89,7 +89,7 @@ class LIBPBD_API Selector {
void multithreaded (bool yn) {
use_list_lock = yn;
}
-
+
void add (int condition, Selectable *s);
void remove (Selectable *);
int select (unsigned long usecs);
diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h
index 5ab938b257..4069340e42 100644
--- a/libs/pbd/pbd/sequence_property.h
+++ b/libs/pbd/pbd/sequence_property.h
@@ -132,7 +132,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
bool changed () const {
return !_changes.added.empty() || !_changes.removed.empty();
}
-
+
void clear_changes () {
_changes.added.clear ();
_changes.removed.clear ();
@@ -158,12 +158,12 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
if (!changed ()) {
return;
}
-
+
/* Create a property with just the changes and not the actual values */
SequenceProperty<Container>* a = create ();
a->_changes = _changes;
changes.add (a);
-
+
if (cmd) {
/* whenever one of the items emits DropReferences, make sure
that the Destructible we've been told to notify hears about
@@ -182,7 +182,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
XMLNodeList const children = node.children ();
/* find the node for this property name */
-
+
std::string const c = capitalize (property_name ());
XMLNodeList::const_iterator i = children.begin();
while (i != children.end() && (*i)->name() != c) {
@@ -194,7 +194,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
}
/* create a property with the changes */
-
+
SequenceProperty<Container>* p = create ();
XMLNodeList const & grandchildren = (*i)->children ();
@@ -301,7 +301,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
}
_val.clear ();
}
-
+
typename Container::size_type size() const {
return _val.size();
}
@@ -355,12 +355,12 @@ protected:
, _changes (p._changes)
, _update_callback (p._update_callback)
{}
-
+
Container _val; ///< our actual container of things
ChangeRecord _changes; ///< changes to the container (adds/removes) that have happened since clear_changes() was last called
boost::function<void(const ChangeRecord&)> _update_callback;
-private:
+private:
virtual SequenceProperty<Container>* create () const = 0;
};
diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h
index cc70d07ca5..97cfa65300 100644
--- a/libs/pbd/pbd/signals.h
+++ b/libs/pbd/pbd/signals.h
@@ -115,9 +115,9 @@ public:
return r;
}
};
-
+
typedef boost::shared_ptr<Connection> UnscopedConnection;
-
+
class LIBPBD_API ScopedConnection
{
public:
@@ -139,7 +139,7 @@ public:
if (_c == o) {
return *this;
}
-
+
disconnect ();
_c = o;
return *this;
@@ -148,13 +148,13 @@ public:
private:
UnscopedConnection _c;
};
-
+
class LIBPBD_API ScopedConnectionList : public boost::noncopyable
{
public:
ScopedConnectionList();
virtual ~ScopedConnectionList ();
-
+
void add_connection (const UnscopedConnection& c);
void drop_connections ();
@@ -168,7 +168,7 @@ class LIBPBD_API ScopedConnectionList : public boost::noncopyable
(1) (unlikely) we make a connection involving a callback on the
same object from 2 threads. (wouldn't that just be appalling
programming style?)
-
+
(2) where we are dropping connections in one thread and adding
one from another.
*/
@@ -179,8 +179,8 @@ class LIBPBD_API ScopedConnectionList : public boost::noncopyable
ConnectionList _list;
};
-#include "pbd/signals_generated.h"
-
+#include "pbd/signals_generated.h"
+
} /* namespace */
#endif /* __pbd_signals_h__ */
diff --git a/libs/pbd/pbd/stacktrace.h b/libs/pbd/pbd/stacktrace.h
index 754501eea7..17a719e9ae 100644
--- a/libs/pbd/pbd/stacktrace.h
+++ b/libs/pbd/pbd/stacktrace.h
@@ -90,9 +90,9 @@ class /*LIBPBD_API*/ thing_with_backtrace
for (x = all.begin(); x != all.end(); ++x) {
char **strings;
size_t i;
-
+
strings = backtrace_symbols ((*x)->allocation_backtrace, (*x)->allocation_backtrace_size);
-
+
if (strings) {
stream << "--- ALLOCATED SHARED_PTR @ " << (*x) << std::endl;
for (i = 0; i < (*x)->allocation_backtrace_size && i < 50U; i++) {
diff --git a/libs/pbd/pbd/stateful.h b/libs/pbd/pbd/stateful.h
index 48f7f24d9a..0d0074210b 100644
--- a/libs/pbd/pbd/stateful.h
+++ b/libs/pbd/pbd/stateful.h
@@ -52,7 +52,7 @@ class LIBPBD_API Stateful {
virtual bool apply_changes (PropertyBase const &);
PropertyChange apply_changes (PropertyList const &);
-
+
const OwnedPropertyList& properties() const { return *_properties; }
void add_property (PropertyBase& s);
@@ -101,7 +101,7 @@ class LIBPBD_API Stateful {
void add_properties (XMLNode &);
PropertyChange set_values (XMLNode const &);
-
+
/* derived classes can implement this to do cross-checking
of property values after either a PropertyList or XML
driven property change.
diff --git a/libs/pbd/pbd/stateful_diff_command.h b/libs/pbd/pbd/stateful_diff_command.h
index 95ece8732a..ce82b5ee74 100644
--- a/libs/pbd/pbd/stateful_diff_command.h
+++ b/libs/pbd/pbd/stateful_diff_command.h
@@ -29,7 +29,7 @@
namespace PBD
{
-class StatefulDestructible;
+class StatefulDestructible;
class PropertyList;
/** A Command which stores its action as the differences between the before and after
diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h
index 3e9040bfad..492e9285f9 100644
--- a/libs/pbd/pbd/stl_delete.h
+++ b/libs/pbd/pbd/stl_delete.h
@@ -29,7 +29,7 @@
template<class T> /*LIBPBD_API*/ void vector_delete (std::vector<T *> *vec)
{
typename std::vector<T *>::iterator i;
-
+
for (i = vec->begin(); i != vec->end(); i++) {
delete *i;
}
@@ -79,7 +79,7 @@ template<class T> /*LIBPBD_API*/ void slist_delete (std::slist<T *> *l)
template<class T> void /*LIBPBD_API*/ set_delete (std::set<T *> *sset)
{
typename std::set<T *>::iterator i;
-
+
for (i = sset->begin(); i != sset->end(); i++) {
delete *i;
}
diff --git a/libs/pbd/pbd/touchable.h b/libs/pbd/pbd/touchable.h
index 797260882a..00c5896663 100644
--- a/libs/pbd/pbd/touchable.h
+++ b/libs/pbd/pbd/touchable.h
@@ -46,7 +46,7 @@ class /*LIBPBD_API*/ DynamicTouchable : public Touchable
void touch () {
(object.*method)();
}
-
+
protected:
T& object;
void (T::*method)(void);
@@ -62,7 +62,7 @@ class /*LIBPBD_API*/ DynamicTouchable1 : public Touchable
void touch () {
(object.*method)(arg);
}
-
+
protected:
T1& object;
void (T1::*method)(T2);
@@ -79,12 +79,12 @@ class /*LIBPBD_API*/ DynamicTouchable2 : public Touchable
void touch () {
(object.*method)(arg1, arg2);
}
-
+
protected:
T1& object;
void (T1::*method)(T2,T3);
T2 arg1;
T3 arg2;
};
-
+
#endif // __pbd_touchable_h__
diff --git a/libs/pbd/pbd/transmitter.h b/libs/pbd/pbd/transmitter.h
index cf1e587dfd..a765f9e370 100644
--- a/libs/pbd/pbd/transmitter.h
+++ b/libs/pbd/pbd/transmitter.h
@@ -94,7 +94,7 @@ endmsg (std::ostream &ostr)
/* hmm. not a Transmitter, so just put a newline on
it and assume that that will be enough.
*/
-
+
ostr << std::endl;
}
diff --git a/libs/pbd/pbd/undo.h b/libs/pbd/pbd/undo.h
index f248b8b657..01e1972e99 100644
--- a/libs/pbd/pbd/undo.h
+++ b/libs/pbd/pbd/undo.h
@@ -71,7 +71,7 @@ class LIBPBD_API UndoTransaction : public Command
bool _clearing;
friend void command_death (UndoTransaction*, Command *);
-
+
void about_to_explicitly_delete ();
};
@@ -80,14 +80,14 @@ class LIBPBD_API UndoHistory : public PBD::ScopedConnectionList
public:
UndoHistory();
~UndoHistory() {}
-
+
void add (UndoTransaction* ut);
void undo (unsigned int n);
void redo (unsigned int n);
-
+
unsigned long undo_depth() const { return UndoList.size(); }
unsigned long redo_depth() const { return RedoList.size(); }
-
+
std::string next_undo() const { return (UndoList.empty() ? std::string() : UndoList.back()->name()); }
std::string next_redo() const { return (RedoList.empty() ? std::string() : RedoList.back()->name()); }
@@ -111,7 +111,7 @@ class LIBPBD_API UndoHistory : public PBD::ScopedConnectionList
PBD::Signal0<void> Changed;
PBD::Signal0<void> BeginUndoRedo;
PBD::Signal0<void> EndUndoRedo;
-
+
private:
bool _clearing;
uint32_t _depth;
diff --git a/libs/pbd/pbd/unwind.h b/libs/pbd/pbd/unwind.h
index 1e84d21b29..d4c43d05bd 100644
--- a/libs/pbd/pbd/unwind.h
+++ b/libs/pbd/pbd/unwind.h
@@ -29,7 +29,7 @@ class /*LIBPBD_API*/ Unwinder {
public:
Unwinder (T& var, T new_val) : _var (var), _old_val (var) { var = new_val; }
~Unwinder () { _var = _old_val; }
-
+
private:
T& _var;
T _old_val;
diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h
index 396280921c..8e0e015870 100644
--- a/libs/pbd/pbd/xml++.h
+++ b/libs/pbd/pbd/xml++.h
@@ -85,7 +85,7 @@ public:
private:
bool read_internal(bool validate);
-
+
std::string _filename;
XMLNode* _root;
xmlDocPtr _doc;
@@ -121,7 +121,7 @@ public:
XMLProperty* property(const std::string&);
const XMLProperty* property(const char* n) const { return const_cast<XMLNode*>(this)->property(n); }
const XMLProperty* property(const std::string& n) const { return const_cast<XMLNode*>(this)->property(n); }
-
+
XMLProperty* add_property(const char* name, const std::string& value);
XMLProperty* add_property(const char* name, const char* value = "");
XMLProperty* add_property(const char* name, const long value);
diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc
index ef14cd0a75..249a31ddb3 100644
--- a/libs/pbd/pool.cc
+++ b/libs/pbd/pool.cc
@@ -91,7 +91,7 @@ Pool::alloc ()
}
/** Release an item's memory by writing its location to the free list */
-void
+void
Pool::release (void *ptr)
{
free_list.write (&ptr, 1);
@@ -228,7 +228,7 @@ void
PerThreadPool::add_to_trash (CrossThreadPool* p)
{
Glib::Threads::Mutex::Lock lm (_trash_mutex);
-
+
if (!_trash) {
warning << "Pool " << p->name() << " has no trash collector; a memory leak has therefore occurred" << endmsg;
return;
@@ -237,7 +237,7 @@ PerThreadPool::add_to_trash (CrossThreadPool* p)
/* we have a lock here so that multiple threads can safely call add_to_trash (even though there
can only be one writer to the _trash RingBuffer)
*/
-
+
_trash->write (&p, 1);
}
@@ -246,7 +246,7 @@ CrossThreadPool::CrossThreadPool (string n, unsigned long isize, unsigned long
, pending (nitems)
, _parent (p)
{
-
+
}
void
@@ -261,10 +261,10 @@ CrossThreadPool::flush_pending ()
{
void* ptr;
bool did_release = false;
-
+
DEBUG_TRACE (DEBUG::Pool, string_compose ("%1 %2 has %3 pending free entries waiting, status size %4 free %5 used %6\n", pthread_name(), name(), pending.read_space(),
total(), available(), used()));
-
+
while (pending.read (&ptr, 1) == 1) {
DEBUG_TRACE (DEBUG::Pool, string_compose ("%1 %2 pushes back a pending free list entry before allocating\n", pthread_name(), name()));
free_list.write (&ptr, 1);
diff --git a/libs/pbd/property_list.cc b/libs/pbd/property_list.cc
index c2cf4a0b86..ae8674c97b 100644
--- a/libs/pbd/property_list.cc
+++ b/libs/pbd/property_list.cc
@@ -27,7 +27,7 @@ using namespace PBD;
PropertyList::PropertyList()
: _property_owner (true)
{
-
+
}
PropertyList::PropertyList (PropertyList const & other)
diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc
index 190a229fb8..1abe6a95fb 100644
--- a/libs/pbd/pthread_utils.cc
+++ b/libs/pbd/pthread_utils.cc
@@ -137,7 +137,7 @@ void
pthread_set_name (const char *str)
{
/* copy string and delete it when exiting */
-
+
thread_name.set (strdup (str));
}
@@ -154,7 +154,7 @@ pthread_name ()
void
pthread_kill_all (int signum)
-{
+{
pthread_mutex_lock (&thread_map_lock);
for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) {
if (!pthread_equal ((*i), pthread_self())) {
@@ -167,7 +167,7 @@ pthread_kill_all (int signum)
void
pthread_cancel_all ()
-{
+{
pthread_mutex_lock (&thread_map_lock);
for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ) {
@@ -187,7 +187,7 @@ pthread_cancel_all ()
void
pthread_cancel_one (pthread_t thread)
-{
+{
pthread_mutex_lock (&thread_map_lock);
for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) {
if (pthread_equal ((*i), thread)) {
diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc
index 337be399e3..d1dc8c39f0 100644
--- a/libs/pbd/search_path.cc
+++ b/libs/pbd/search_path.cc
@@ -159,7 +159,7 @@ Searchpath::add_subdirectory_to_paths (const string& subdir)
// the search path rather than replace?
*i = Glib::build_filename (*i, subdir);
}
-
+
return *this;
}
diff --git a/libs/pbd/semutils.cc b/libs/pbd/semutils.cc
index cf7b54d30e..5d3ef3d958 100644
--- a/libs/pbd/semutils.cc
+++ b/libs/pbd/semutils.cc
@@ -34,7 +34,7 @@ ProcessSemaphore::ProcessSemaphore (const char* name, int val)
}
/* this semaphore does not exist for IPC */
-
+
if (sem_unlink (name)) {
throw failed_constructor ();
}
diff --git a/libs/pbd/shortpath.cc b/libs/pbd/shortpath.cc
index d2d5addc94..3d33611b87 100644
--- a/libs/pbd/shortpath.cc
+++ b/libs/pbd/shortpath.cc
@@ -57,7 +57,7 @@ short_path (const Glib::ustring& path, ustring::size_type target_characters)
return path;
}
}
-
+
uint32_t so_far = (len - last_sep);
uint32_t space_for = target_characters - so_far;
@@ -71,6 +71,6 @@ short_path (const Glib::ustring& path, ustring::size_type target_characters)
res += path.substr (last_sep - space_for, len - last_sep + space_for - 3);
res += "...";
return res;
-
+
}
}
diff --git a/libs/pbd/stacktrace.cc b/libs/pbd/stacktrace.cc
index db27fd54df..176c5b8840 100644
--- a/libs/pbd/stacktrace.cc
+++ b/libs/pbd/stacktrace.cc
@@ -51,13 +51,13 @@ symbol_demangle (const std::string& l)
int status;
try {
-
+
char* realname = abi::__cxa_demangle (l.c_str(), 0, 0, &status);
std::string d (realname);
free (realname);
return d;
} catch (std::exception) {
-
+
}
return l;
@@ -80,7 +80,7 @@ PBD::demangle (std::string const & l)
if ((p - b) <= 1) {
return symbol_demangle (l);
}
-
+
std::string const fn = l.substr (b + 1, p - b - 1);
return symbol_demangle (fn);
@@ -100,11 +100,11 @@ PBD::stacktrace (std::ostream& out, int levels)
strings = backtrace_symbols (array, size);
if (strings) {
-
+
for (i = 0; i < size && (levels == 0 || i < size_t(levels)); i++) {
out << " " << demangle (strings[i]) << std::endl;
}
-
+
free (strings);
}
} else {
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc
index 476fdcc28f..845d6ba42e 100644
--- a/libs/pbd/stateful.cc
+++ b/libs/pbd/stateful.cc
@@ -98,7 +98,7 @@ Stateful::save_extra_xml (const XMLNode& node)
to by _extra_xml if a new Extra node is found, but not
otherwise.
*/
-
+
const XMLNode* xtra = node.child ("Extra");
if (xtra) {
@@ -125,7 +125,7 @@ Stateful::add_instant_xml (XMLNode& node, const std::string& directory_path)
_instant_xml->add_child_copy (node);
std::string instant_xml_path = Glib::build_filename (directory_path, "instant.xml");
-
+
XMLTree tree;
tree.set_filename(instant_xml_path);
@@ -192,7 +192,7 @@ PropertyList *
Stateful::get_changes_as_properties (Command* cmd) const
{
PropertyList* pl = new PropertyList;
-
+
for (OwnedPropertyList::const_iterator i = _properties->begin(); i != _properties->end(); ++i) {
i->second->get_changes_as_properties (*pl, cmd);
}
@@ -209,7 +209,7 @@ PropertyChange
Stateful::set_values (XMLNode const & node)
{
PropertyChange c;
-
+
for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) {
if (i->second->set_value (node)) {
c.add (i->first);
@@ -232,7 +232,7 @@ Stateful::apply_changes (const PropertyList& property_list)
for (PropertyList::const_iterator pp = property_list.begin(); pp != property_list.end(); ++pp) {
DEBUG_TRACE (DEBUG::Stateful, string_compose ("in plist: %1\n", pp->second->property_name()));
}
-
+
for (PropertyList::const_iterator i = property_list.begin(); i != property_list.end(); ++i) {
if ((p = _properties->find (i->first)) != _properties->end()) {
@@ -240,7 +240,7 @@ Stateful::apply_changes (const PropertyList& property_list)
DEBUG::Stateful,
string_compose ("actually setting property %1 using %2\n", p->second->property_name(), i->second->property_name())
);
-
+
if (apply_changes (*i->second)) {
c.add (i->first);
}
@@ -249,7 +249,7 @@ Stateful::apply_changes (const PropertyList& property_list)
i->second->property_name()));
}
}
-
+
post_set (c);
send_change (c);
diff --git a/libs/pbd/strsplit.cc b/libs/pbd/strsplit.cc
index c99b55f0a4..85f0c5c310 100644
--- a/libs/pbd/strsplit.cc
+++ b/libs/pbd/strsplit.cc
@@ -24,7 +24,7 @@ using namespace Glib;
void
split (string str, vector<string>& result, char splitchar)
-{
+{
string::size_type pos;
string remaining;
string::size_type len = str.length();
@@ -64,7 +64,7 @@ split (string str, vector<string>& result, char splitchar)
void
split (ustring str, vector<ustring>& result, char splitchar)
-{
+{
ustring::size_type pos;
ustring remaining;
ustring::size_type len = str.length();
diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc
index f2007a71da..d92987bf21 100644
--- a/libs/pbd/system_exec.cc
+++ b/libs/pbd/system_exec.cc
@@ -648,7 +648,7 @@ SystemExec::terminate ()
/* if pid is non-zero, the child task is still executing (i.e. it did
* not exit in response to stdin being closed). try to kill it.
*/
-
+
if (pid) {
::kill(pid, SIGTERM);
::usleep(250000);
diff --git a/libs/pbd/test/scalar_properties.cc b/libs/pbd/test/scalar_properties.cc
index 3586fc3a95..be8ef20655 100644
--- a/libs/pbd/test/scalar_properties.cc
+++ b/libs/pbd/test/scalar_properties.cc
@@ -31,7 +31,7 @@ ScalarPropertiesTest::testBasic ()
_fred.clear_changes ();
CPPUNIT_ASSERT (_fred.changed() == false);
-
+
_fred = 5;
CPPUNIT_ASSERT (_fred == 5);
CPPUNIT_ASSERT (_fred.changed() == true);
diff --git a/libs/pbd/test/scalar_properties.h b/libs/pbd/test/scalar_properties.h
index 6175aeacfe..d313477659 100644
--- a/libs/pbd/test/scalar_properties.h
+++ b/libs/pbd/test/scalar_properties.h
@@ -13,7 +13,7 @@ public:
void testBasic ();
static void make_property_quarks ();
-
+
private:
PBD::Property<int> _fred;
};
diff --git a/libs/pbd/test/signals_test.cc b/libs/pbd/test/signals_test.cc
index fd845c8be1..ab70388760 100644
--- a/libs/pbd/test/signals_test.cc
+++ b/libs/pbd/test/signals_test.cc
@@ -20,7 +20,7 @@ public:
void emit () {
Fred ();
}
-
+
PBD::Signal0<void> Fred;
};
@@ -86,6 +86,6 @@ SignalsTest::testScopedConnectionList ()
e->emit ();
delete r;
e->emit ();
-
+
CPPUNIT_ASSERT_EQUAL (1, N);
}
diff --git a/libs/pbd/test/testrunner.cc b/libs/pbd/test/testrunner.cc
index 11f60f46a2..92757eb45d 100644
--- a/libs/pbd/test/testrunner.cc
+++ b/libs/pbd/test/testrunner.cc
@@ -24,19 +24,19 @@ main ()
text_receiver.listen_to (PBD::warning);
ScalarPropertiesTest::make_property_quarks ();
-
+
CppUnit::TestResult testresult;
CppUnit::TestResultCollector collectedresults;
testresult.addListener (&collectedresults);
-
+
CppUnit::BriefTestProgressListener progress;
testresult.addListener (&progress);
-
+
CppUnit::TestRunner testrunner;
testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
testrunner.run (testresult);
-
+
CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
compileroutputter.write ();
diff --git a/libs/pbd/test/xpath.cc b/libs/pbd/test/xpath.cc
index 70240d3d69..2283c946e4 100644
--- a/libs/pbd/test/xpath.cc
+++ b/libs/pbd/test/xpath.cc
@@ -23,7 +23,7 @@ XPathTest::testMisc ()
XMLTree doc(testdata_path);
// "//bank" gives as last element an empty element libxml bug????
boost::shared_ptr<XMLSharedNodeList> result = doc.find("//bank[@name]");
-
+
// cout << "Found " << result->size() << " banks" << endl;
assert(result->size() == 8);
// int counter = 1;
@@ -36,19 +36,19 @@ XPathTest::testMisc ()
// " with name: " << (*j)->property("name")->value() << endl;
}
}
-
+
// cout << endl << endl << "Test 2: RosegardenPatchFile.xml: Find all programs whose program name contains 'Latin'" << endl;
-
+
result = doc.find("/rosegarden-data/studio/device/bank/program[contains(@name, 'Latin')]");
assert(result->size() == 5);
-
+
for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) {
// cout << "\t found program " << (*i)->property("id")->value() <<
// " with name: " << (*i)->property("name")->value() << endl;
}
// cout << endl << endl << "Test 3: TestSession.ardour: find all Sources where captured-for contains the string 'Guitar'" << endl;
-
+
// We have to allocate a new document here, or we get segfaults
std::string testsession_path;
CPPUNIT_ASSERT (find_file (test_search_path (), "TestSession.ardour", testsession_path));
@@ -56,16 +56,16 @@ XPathTest::testMisc ()
XMLTree doc2(testsession_path);
result = doc2.find("/Session/Sources/Source[contains(@captured-for, 'Guitar')]");
assert(result->size() == 16);
-
+
for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) {
// cout << "\t found source '" << (*i)->property("name")->value() <<
// "' with id: " << (*i)->property("id")->value() << endl;
}
-
+
// cout << endl << endl << "Test 4: TestSession.ardour: Find all elements with an 'id' and 'name' attribute" << endl;
-
+
result = doc2.find("//*[@id and @name]");
-
+
for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) {
assert((*i)->property("id"));
assert((*i)->property("name"));
@@ -73,9 +73,9 @@ XPathTest::testMisc ()
// "' with id: " << (*i)->property("id")->value() <<
// "' and name: " << (*i)->property("name")->value() << endl;
}
-
+
// cout << endl << endl << "Test 5: ProtoolsPatchFile.midnam: Get Banks and Patches for 'Name Set 1'" << endl;
-
+
std::string testmidnam_path;
CPPUNIT_ASSERT (find_file (test_search_path (), "ProtoolsPatchFile.midnam", testmidnam_path));
@@ -83,7 +83,7 @@ XPathTest::testMisc ()
XMLTree doc3(testmidnam_path);
result = doc3.find("/MIDINameDocument/MasterDeviceNames/ChannelNameSet[@Name='Name Set 1']/PatchBank");
assert(result->size() == 16);
-
+
for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) {
// cout << "\t found Patchbank " << (*i)->property("Name")->value() << endl;
boost::shared_ptr<XMLSharedNodeList> patches = doc3.find ("//Patch[@Name]", i->get());
@@ -95,22 +95,22 @@ XPathTest::testMisc ()
// cout << endl << endl << "Test 5: ProtoolsPatchFile.midnam: Find attribute nodes" << endl;
result = doc3.find("//@Value");
-
+
for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) {
boost::shared_ptr<XMLNode> node = (*i);
// cout << "\t found attribute node: " << node->name()
// << " value: " << node->attribute_value() << endl;
- }
-
+ }
+
// cout << endl << endl << "Test 6: ProtoolsPatchFile.midnam: Find available channels on 'Name Set 1'" << endl;
result = doc3.find(
"//ChannelNameSet[@Name = 'Name Set 1']//AvailableChannel[@Available = 'true']/@Channel");
-
+
assert(result->size() == 15);
for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) {
boost::shared_ptr<XMLNode> node = (*i);
// cout << "\t found available Channel: " << node->name()
// << " value: " << node->attribute_value() << endl;
- }
-
+ }
+
}
diff --git a/libs/pbd/textreceiver.cc b/libs/pbd/textreceiver.cc
index 6326a33934..3d9ce0f4a2 100644
--- a/libs/pbd/textreceiver.cc
+++ b/libs/pbd/textreceiver.cc
@@ -58,7 +58,7 @@ TextReceiver::receive (Transmitter::Channel chn, const char *str)
/* note: iostreams are already thread-safe: no external
lock required.
*/
-
+
cout << name << prefix << str << endl;
if (chn == Transmitter::Fatal) {
diff --git a/libs/pbd/transmitter.cc b/libs/pbd/transmitter.cc
index 7df370e803..fccb667b48 100644
--- a/libs/pbd/transmitter.cc
+++ b/libs/pbd/transmitter.cc
@@ -52,7 +52,7 @@ Transmitter::Transmitter (Channel c)
send = 0;
break;
}
-}
+}
void
Transmitter::deliver ()
@@ -82,12 +82,12 @@ Transmitter::deliver ()
seekg (0, ios::beg);
/* do the right thing if this should not return */
-
+
if (does_not_return()) {
#ifndef PLATFORM_WINDOWS
// TODO !!!! Commented out temporarily (for Windows)
sigset_t mask;
-
+
sigemptyset (&mask);
sigsuspend (&mask);
/*NOTREACHED*/
diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc
index ee5c56f3a5..a11edbda47 100644
--- a/libs/pbd/undo.cc
+++ b/libs/pbd/undo.cc
@@ -282,7 +282,7 @@ UndoHistory::redo (unsigned int n)
{
UndoRedoSignaller exception_safe_signaller (*this);
-
+
while (n--) {
if (RedoList.size() == 0) {
return;
diff --git a/libs/pbd/whitespace.cc b/libs/pbd/whitespace.cc
index fa4a94b995..57c133db26 100644
--- a/libs/pbd/whitespace.cc
+++ b/libs/pbd/whitespace.cc
@@ -22,14 +22,14 @@
using namespace std;
namespace PBD {
-
+
void
strip_whitespace_edges (string& str)
{
string::size_type i;
string::size_type len;
string::size_type s = 0;
-
+
len = str.length();
if (len == 1) {
@@ -37,7 +37,7 @@ strip_whitespace_edges (string& str)
}
/* strip front */
-
+
for (i = 0; i < len; ++i) {
if (!isspace (str[i])) {
break;
@@ -60,7 +60,7 @@ strip_whitespace_edges (string& str)
if (s == i) {
return;
}
-
+
do {
if (!isspace (str[i]) || i == 0) {
break;
@@ -69,7 +69,7 @@ strip_whitespace_edges (string& str)
--i;
} while (true);
-
+
str = str.substr (s, (i - s) + 1);
} else {
diff --git a/libs/pbd/windows_special_dirs.cc b/libs/pbd/windows_special_dirs.cc
index d5138050df..75ec322353 100644
--- a/libs/pbd/windows_special_dirs.cc
+++ b/libs/pbd/windows_special_dirs.cc
@@ -30,7 +30,7 @@ PBD::get_win_special_folder_path (int csidl)
HRESULT hr;
LPITEMIDLIST pidl = 0;
char *utf8_folder_path = 0;
-
+
if (S_OK == (hr = SHGetSpecialFolderLocation (0, csidl, &pidl))) {
if (SHGetPathFromIDListW (pidl, path)) {
diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc
index 5667e933a5..4e566a7800 100644
--- a/libs/pbd/xml++.cc
+++ b/libs/pbd/xml++.cc
@@ -42,7 +42,7 @@ XMLTree::XMLTree(const XMLTree* from)
, _doc (xmlCopyDoc (from->_doc, 1))
, _compression(from->compression())
{
-
+
}
XMLTree::~XMLTree()
@@ -96,7 +96,7 @@ XMLTree::read_internal(bool validate)
} else {
_doc = xmlParseFile(_filename.c_str());
}
-
+
/* check if parsing suceeded */
if (_doc == NULL) {
if (validate) {
@@ -117,7 +117,7 @@ XMLTree::read_internal(bool validate)
if (validate) {
xmlFreeParserCtxt(ctxt);
}
-
+
return true;
}
@@ -271,17 +271,17 @@ XMLNode::operator= (const XMLNode& from)
XMLPropertyIterator curprop;
XMLNodeList nodes;
XMLNodeIterator curnode;
-
+
clear_lists ();
_name = from.name();
set_content(from.content());
-
+
props = from.properties();
for (curprop = props.begin(); curprop != props.end(); ++curprop) {
add_property((*curprop)->name().c_str(), (*curprop)->value());
}
-
+
nodes = from.children();
for (curnode = nodes.begin(); curnode != nodes.end(); ++curnode) {
add_child_copy(**curnode);
@@ -380,10 +380,10 @@ XMLTree::find(const string xpath, XMLNode* node) const
} else {
ctxt = xmlXPathNewContext(_doc);
}
-
+
boost::shared_ptr<XMLSharedNodeList> result =
boost::shared_ptr<XMLSharedNodeList>(find_impl(ctxt, xpath));
-
+
xmlXPathFreeContext(ctxt);
if (doc) {
xmlFreeDoc (doc);
@@ -439,7 +439,7 @@ XMLNode::add_property(const char* n, const string& v)
{
string ns(n);
map<string,XMLProperty*>::iterator iter;
-
+
if ((iter = _propmap.find(ns)) != _propmap.end()) {
iter->second->set_value (v);
return iter->second;
@@ -676,11 +676,11 @@ XMLNode::dump (ostream& s, string p) const
s << " " << (*i)->name() << "=\"" << (*i)->value() << "\"";
}
s << ">\n";
-
+
for (XMLNodeList::const_iterator i = _children.begin(); i != _children.end(); ++i) {
(*i)->dump (s, p + " ");
}
-
+
s << p << "</" << _name << ">\n";
}
}
diff --git a/libs/ptformat/ptfformat.cc b/libs/ptformat/ptfformat.cc
index ac750ecc99..f233f51dfa 100644
--- a/libs/ptformat/ptfformat.cc
+++ b/libs/ptformat/ptfformat.cc
@@ -667,7 +667,7 @@ PTFFormat::parseaudio5(void) {
break;
}
}
-
+
wavnumber = 0;
i+=16;
while (i < len && numberofwavs > 0) {
diff --git a/libs/qm-dsp/base/Window.h b/libs/qm-dsp/base/Window.h
index 686d023c6b..02ca426d66 100644
--- a/libs/qm-dsp/base/Window.h
+++ b/libs/qm-dsp/base/Window.h
@@ -72,53 +72,53 @@ void Window<T>::encache()
for (i = 0; i < n; ++i) mult[i] = 1.0;
switch (m_type) {
-
+
case RectangularWindow:
for (i = 0; i < n; ++i) {
mult[i] = mult[i] * 0.5;
}
break;
-
+
case BartlettWindow:
for (i = 0; i < n/2; ++i) {
mult[i] = mult[i] * (i / T(n/2));
mult[i + n/2] = mult[i + n/2] * (1.0 - (i / T(n/2)));
}
break;
-
+
case HammingWindow:
for (i = 0; i < n; ++i) {
mult[i] = mult[i] * (0.54 - 0.46 * cos(2 * M_PI * i / n));
}
break;
-
+
case HanningWindow:
for (i = 0; i < n; ++i) {
mult[i] = mult[i] * (0.50 - 0.50 * cos(2 * M_PI * i / n));
}
break;
-
+
case BlackmanWindow:
for (i = 0; i < n; ++i) {
mult[i] = mult[i] * (0.42 - 0.50 * cos(2 * M_PI * i / n)
+ 0.08 * cos(4 * M_PI * i / n));
}
break;
-
+
case GaussianWindow:
for (i = 0; i < n; ++i) {
mult[i] = mult[i] * exp((-1.0 / (n*n)) * ((T(2*i) - n) *
(T(2*i) - n)));
}
break;
-
+
case ParzenWindow:
for (i = 0; i < n; ++i) {
mult[i] = mult[i] * (1.0 - fabs((T(2*i) - n) / T(n + 1)));
}
break;
}
-
+
m_cache = mult;
}
diff --git a/libs/qm-dsp/dsp/chromagram/Chromagram.cpp b/libs/qm-dsp/dsp/chromagram/Chromagram.cpp
index 83a6661d17..5901082352 100644
--- a/libs/qm-dsp/dsp/chromagram/Chromagram.cpp
+++ b/libs/qm-dsp/dsp/chromagram/Chromagram.cpp
@@ -27,14 +27,14 @@ Chromagram::Chromagram( ChromaConfig Config ) :
}
int Chromagram::initialise( ChromaConfig Config )
-{
+{
m_FMin = Config.min; // min freq
m_FMax = Config.max; // max freq
m_BPO = Config.BPO; // bins per octave
m_normalise = Config.normalise; // if frame normalisation is required
// No. of constant Q bins
- m_uK = ( unsigned int ) ceil( m_BPO * log(m_FMax/m_FMin)/log(2.0));
+ m_uK = ( unsigned int ) ceil( m_BPO * log(m_FMax/m_FMin)/log(2.0));
// Create array for chroma result
m_chromadata = new double[ m_BPO ];
@@ -49,7 +49,7 @@ int Chromagram::initialise( ChromaConfig Config )
ConstantQConfig.max = m_FMax;
ConstantQConfig.BPO = m_BPO;
ConstantQConfig.CQThresh = Config.CQThresh;
-
+
// Initialise ConstantQ operator
m_ConstantQ = new ConstantQ( ConstantQConfig );
@@ -57,7 +57,7 @@ int Chromagram::initialise( ChromaConfig Config )
m_frameSize = m_ConstantQ->getfftlength();
m_hopSize = m_ConstantQ->gethop();
- // Initialise FFT object
+ // Initialise FFT object
m_FFT = new FFTReal(m_frameSize);
m_FFTRe = new double[ m_frameSize ];
@@ -161,7 +161,7 @@ double* Chromagram::process( const double *real, const double *imag )
// Calculate ConstantQ frame
m_ConstantQ->process( real, imag, m_CQRe, m_CQIm );
-
+
// add each octave of cq data into Chromagram
const unsigned octaves = (int)floor(double( m_uK/m_BPO))-1;
for (unsigned octave = 0; octave <= octaves; octave++)
diff --git a/libs/qm-dsp/dsp/chromagram/Chromagram.h b/libs/qm-dsp/dsp/chromagram/Chromagram.h
index 37af153be3..f04ffda83a 100644
--- a/libs/qm-dsp/dsp/chromagram/Chromagram.h
+++ b/libs/qm-dsp/dsp/chromagram/Chromagram.h
@@ -32,17 +32,17 @@ struct ChromaConfig{
class Chromagram
{
-public:
+public:
Chromagram( ChromaConfig Config );
~Chromagram();
-
+
double* process( const double *data ); // time domain
double* process( const double *real, const double *imag ); // frequency domain
void unityNormalise( double* src );
// Complex arithmetic
double kabs( double real, double imag );
-
+
// Results
unsigned int getK() { return m_uK;}
unsigned int getFrameSize() { return m_frameSize; }
@@ -54,7 +54,7 @@ private:
Window<double> *m_window;
double *m_windowbuf;
-
+
double* m_chromadata;
double m_FMin;
double m_FMax;
diff --git a/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp b/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp
index 222fd80a36..fa6c32c26b 100644
--- a/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp
+++ b/libs/qm-dsp/dsp/chromagram/ConstantQ.cpp
@@ -109,14 +109,14 @@ void ConstantQ::sparsekernel()
sk->js.reserve( m_FFTLength*2 );
sk->real.reserve( m_FFTLength*2 );
sk->imag.reserve( m_FFTLength*2 );
-
+
// for each bin value K, calculate temporal kernel, take its fft to
//calculate the spectral kernel then threshold it to make it sparse and
//add it to the sparse kernels matrix
double squareThreshold = m_CQThresh * m_CQThresh;
FFT m_FFT(m_FFTLength);
-
+
for (unsigned k = m_uK; k--; )
{
for (unsigned u=0; u < m_FFTLength; u++)
@@ -152,13 +152,13 @@ void ConstantQ::sparsekernel()
//do fft of hammingWindow
m_FFT.process( 0, hammingWindowRe, hammingWindowIm, transfHammingWindowRe, transfHammingWindowIm );
-
+
for (unsigned j=0; j<( m_FFTLength ); j++)
{
// perform thresholding
const double squaredBin = squaredModule( transfHammingWindowRe[ j ], transfHammingWindowIm[ j ]);
if (squaredBin <= squareThreshold) continue;
-
+
// Insert non-zero position indexes, doubled because they are floats
sk->is.push_back(j);
sk->js.push_back(k);
@@ -266,7 +266,7 @@ double* ConstantQ::process( const double* fftdata )
const double *real = &(sk->real[0]);
const double *imag = &(sk->imag[0]);
const unsigned int sparseCells = sk->real.size();
-
+
for (unsigned i = 0; i<sparseCells; i++)
{
const unsigned row = cqbin[i];
@@ -335,7 +335,7 @@ void ConstantQ::process(const double *FFTRe, const double* FFTIm,
const double *real = &(sk->real[0]);
const double *imag = &(sk->imag[0]);
const unsigned int sparseCells = sk->real.size();
-
+
for (unsigned i = 0; i<sparseCells; i++)
{
const unsigned row = cqbin[i];
diff --git a/libs/qm-dsp/dsp/chromagram/ConstantQ.h b/libs/qm-dsp/dsp/chromagram/ConstantQ.h
index c06f60a9d0..597e3d0087 100644
--- a/libs/qm-dsp/dsp/chromagram/ConstantQ.h
+++ b/libs/qm-dsp/dsp/chromagram/ConstantQ.h
@@ -29,7 +29,7 @@ struct CQConfig{
};
class ConstantQ {
-
+
//public functions incl. sparsekernel so can keep out of loop in main
public:
void process( const double* FFTRe, const double* FFTIm,
@@ -46,7 +46,7 @@ public:
double out = 0.54 - 0.46*cos(2*PI*n/len);
return(out);
}
-
+
int getnumwin() { return m_numWin;}
double getQ() { return m_dQ;}
int getK() {return m_uK ;}
@@ -56,7 +56,7 @@ public:
private:
void initialise( CQConfig Config );
void deInitialise();
-
+
double* m_CQdata;
unsigned int m_FS;
double m_FMin;
diff --git a/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp b/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp
index ae22cfb11d..af65af8cd2 100644
--- a/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp
+++ b/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp
@@ -53,7 +53,7 @@ void DetectionFunction::initialise( DFConfig Config )
m_magHistory = new double[ m_halfLength ];
memset(m_magHistory,0, m_halfLength*sizeof(double));
-
+
m_phaseHistory = new double[ m_halfLength ];
memset(m_phaseHistory,0, m_halfLength*sizeof(double));
@@ -152,15 +152,15 @@ double DetectionFunction::runDF()
case DF_HFC:
retVal = HFC( m_halfLength, m_magnitude);
break;
-
+
case DF_SPECDIFF:
retVal = specDiff( m_halfLength, m_magnitude);
break;
-
+
case DF_PHASEDEV:
retVal = phaseDev( m_halfLength, m_thetaAngle);
break;
-
+
case DF_COMPLEXSD:
retVal = complexSD( m_halfLength, m_magnitude, m_thetaAngle);
break;
@@ -169,7 +169,7 @@ double DetectionFunction::runDF()
retVal = broadband( m_halfLength, m_magnitude);
break;
}
-
+
return retVal;
}
@@ -195,7 +195,7 @@ double DetectionFunction::specDiff(unsigned int length, double *src)
for( i = 0; i < length; i++)
{
temp = fabs( (src[ i ] * src[ i ]) - (m_magHistory[ i ] * m_magHistory[ i ]) );
-
+
diff= sqrt(temp);
// (See note in phaseDev below.)
@@ -230,15 +230,15 @@ double DetectionFunction::phaseDev(unsigned int length, double *srcPhase)
// does significantly damage its ability to work with quieter
// music, so I'm removing it and counting the result always.
// Same goes for the spectral difference measure above.
-
+
tmpVal = fabs(dev);
val += tmpVal ;
m_phaseHistoryOld[ i ] = m_phaseHistory[ i ] ;
m_phaseHistory[ i ] = srcPhase[ i ];
}
-
-
+
+
return val;
}
@@ -259,14 +259,14 @@ double DetectionFunction::complexSD(unsigned int length, double *srcMagnitude, d
{
tmpPhase = (srcPhase[ i ]- 2*m_phaseHistory[ i ]+m_phaseHistoryOld[ i ]);
dev= MathUtilities::princarg( tmpPhase );
-
+
meas = m_magHistory[i] - ( srcMagnitude[ i ] * exp( j * dev) );
tmpReal = real( meas );
tmpImag = imag( meas );
val += sqrt( (tmpReal * tmpReal) + (tmpImag * tmpImag) );
-
+
m_phaseHistoryOld[ i ] = m_phaseHistory[ i ] ;
m_phaseHistory[ i ] = srcPhase[ i ];
m_magHistory[ i ] = srcMagnitude[ i ];
diff --git a/libs/qm-dsp/dsp/onsets/DetectionFunction.h b/libs/qm-dsp/dsp/onsets/DetectionFunction.h
index 083d0a2a06..1102ec416d 100644
--- a/libs/qm-dsp/dsp/onsets/DetectionFunction.h
+++ b/libs/qm-dsp/dsp/onsets/DetectionFunction.h
@@ -55,7 +55,7 @@ private:
double phaseDev(unsigned int length, double *srcPhase);
double complexSD(unsigned int length, double *srcMagnitude, double *srcPhase);
double broadband(unsigned int length, double *srcMagnitude);
-
+
private:
void initialise( DFConfig Config );
void deInitialise();
diff --git a/libs/qm-dsp/dsp/onsets/PeakPicking.cpp b/libs/qm-dsp/dsp/onsets/PeakPicking.cpp
index 472897b241..ea50223e15 100644
--- a/libs/qm-dsp/dsp/onsets/PeakPicking.cpp
+++ b/libs/qm-dsp/dsp/onsets/PeakPicking.cpp
@@ -41,7 +41,7 @@ void PeakPicking::initialise( PPickParams Config )
Qfilta = Config.QuadThresh.a ;
Qfiltb = Config.QuadThresh.b ;
Qfiltc = Config.QuadThresh.c ;
-
+
m_DFProcessingParams.length = m_DFLength;
m_DFProcessingParams.LPOrd = Config.LPOrd;
m_DFProcessingParams.LPACoeffs = Config.LPACoeffs;
@@ -50,7 +50,7 @@ void PeakPicking::initialise( PPickParams Config )
m_DFProcessingParams.winPost = Config.WinT.post;
m_DFProcessingParams.AlphaNormParam = Config.alpha;
m_DFProcessingParams.isMedianPositive = false;
-
+
m_DFSmoothing = new DFProcess( m_DFProcessingParams );
m_workBuffer = new double[ m_DFLength ];
@@ -68,16 +68,16 @@ void PeakPicking::process( double* src, unsigned int len, vector<int> &onsets )
{
if (len < 4) return;
- vector <double> m_maxima;
+ vector <double> m_maxima;
// Signal conditioning
m_DFSmoothing->process( src, m_workBuffer );
-
+
for( unsigned int u = 0; u < len; u++)
{
- m_maxima.push_back( m_workBuffer[ u ] );
+ m_maxima.push_back( m_workBuffer[ u ] );
}
-
+
quadEval( m_maxima, onsets );
for(unsigned int b = 0; b < m_maxima.size(); b++)
@@ -92,7 +92,7 @@ int PeakPicking::quadEval( vector<double> &src, vector<int> &idx )
vector <int> m_maxIndex;
vector <int> m_onsetPosition;
-
+
vector <double> m_maxFit;
vector <double> m_poly;
vector <double> m_err;
@@ -123,7 +123,7 @@ int PeakPicking::quadEval( vector<double> &src, vector<int> &idx )
for (int k = -2; k <= 2; ++k)
{
selMax = src[ m_maxIndex[j] + k ] ;
- m_maxFit.push_back(selMax);
+ m_maxFit.push_back(selMax);
}
double f = m_poly[0];
@@ -133,7 +133,7 @@ int PeakPicking::quadEval( vector<double> &src, vector<int> &idx )
{
idx.push_back(m_maxIndex[j]);
}
-
+
m_maxFit.clear();
}
diff --git a/libs/qm-dsp/dsp/onsets/PeakPicking.h b/libs/qm-dsp/dsp/onsets/PeakPicking.h
index be6853ca8f..931c1c16e2 100644
--- a/libs/qm-dsp/dsp/onsets/PeakPicking.h
+++ b/libs/qm-dsp/dsp/onsets/PeakPicking.h
@@ -56,7 +56,7 @@ class PeakPicking
public:
PeakPicking( PPickParams Config );
virtual ~PeakPicking();
-
+
void process( double* src, unsigned int len, vector<int> &onsets );
@@ -64,7 +64,7 @@ private:
void initialise( PPickParams Config );
void deInitialise();
int quadEval( vector<double> &src, vector<int> &idx );
-
+
DFProcConfig m_DFProcessingParams;
unsigned int m_DFLength ;
@@ -74,7 +74,7 @@ private:
double* m_workBuffer;
-
+
DFProcess* m_DFSmoothing;
};
diff --git a/libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp b/libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp
index 26cfcfbabe..cd52f5240a 100644
--- a/libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp
+++ b/libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp
@@ -49,7 +49,7 @@ void PhaseVocoder::FFTShift(unsigned int size, double *src)
void PhaseVocoder::process(double *src, double *mag, double *theta)
{
FFTShift( m_n, src);
-
+
m_fft->process(0, src, m_realOut, m_imagOut);
getMagnitude( m_n/2, mag, m_realOut, m_imagOut);
@@ -57,7 +57,7 @@ void PhaseVocoder::process(double *src, double *mag, double *theta)
}
void PhaseVocoder::getMagnitude(unsigned int size, double *mag, double *real, double *imag)
-{
+{
unsigned int j;
for( j = 0; j < size; j++)
@@ -75,5 +75,5 @@ void PhaseVocoder::getPhase(unsigned int size, double *theta, double *real, doub
for( k = 0; k < size; k++)
{
theta[ k ] = atan2( -imag[ k ], real[ k ]);
- }
+ }
}
diff --git a/libs/qm-dsp/dsp/rateconversion/Decimator.h b/libs/qm-dsp/dsp/rateconversion/Decimator.h
index 1ed49fd397..f8a113a0db 100644
--- a/libs/qm-dsp/dsp/rateconversion/Decimator.h
+++ b/libs/qm-dsp/dsp/rateconversion/Decimator.h
@@ -55,7 +55,7 @@ private:
double a[ 9 ];
double b[ 9 ];
-
+
double* decBuffer;
};
diff --git a/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp b/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp
index 7643691cd3..ce5f370436 100644
--- a/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp
+++ b/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp
@@ -212,7 +212,7 @@ void ClusterMeltSegmenter::extractFeaturesConstQ(const double* samples, int nsam
fft->process(false, frame, real, imag);
constq->process(real, imag, cqre, cqim);
-
+
for (int i = 0; i < ncoeff; ++i) {
cq[i] += sqrt(cqre[i] * cqre[i] + cqim[i] * cqim[i]);
}
@@ -287,7 +287,7 @@ void ClusterMeltSegmenter::extractFeaturesMFCC(const double* samples, int nsampl
}
mfcc->process(frame, ccout);
-
+
for (int i = 0; i < ncoeff; ++i) {
cc[i] += ccout[i];
}
@@ -335,22 +335,22 @@ void ClusterMeltSegmenter::segment()
<< " features with " << features[0].size() << " coefficients (ncoeff = " << ncoeff << ", ncomponents = " << ncomponents << ")" << std::endl;
*/
// copy the features to a native array and use the existing C segmenter...
- double** arrFeatures = new double*[features.size()];
+ double** arrFeatures = new double*[features.size()];
for (int i = 0; i < features.size(); i++)
{
if (featureType == FEATURE_TYPE_UNKNOWN) {
arrFeatures[i] = new double[features[0].size()];
for (int j = 0; j < features[0].size(); j++)
- arrFeatures[i][j] = features[i][j];
+ arrFeatures[i][j] = features[i][j];
} else {
arrFeatures[i] = new double[ncoeff+1]; // allow space for the normalised envelope
for (int j = 0; j < ncoeff; j++)
- arrFeatures[i][j] = features[i][j];
+ arrFeatures[i][j] = features[i][j];
}
}
-
+
q = new int[features.size()];
-
+
if (featureType == FEATURE_TYPE_UNKNOWN ||
featureType == FEATURE_TYPE_MFCC)
cluster_segment(q, arrFeatures, features.size(), features[0].size(), nHMMStates, histogramLength,
@@ -358,16 +358,16 @@ void ClusterMeltSegmenter::segment()
else
constq_segment(q, arrFeatures, features.size(), nbins, ncoeff, featureType,
nHMMStates, histogramLength, nclusters, neighbourhoodLimit);
-
+
// convert the cluster assignment sequence to a segmentation
- makeSegmentation(q, features.size());
-
+ makeSegmentation(q, features.size());
+
// de-allocate arrays
delete [] q;
for (int i = 0; i < features.size(); i++)
delete [] arrFeatures[i];
delete [] arrFeatures;
-
+
// clear the features
clear();
}
@@ -377,11 +377,11 @@ void ClusterMeltSegmenter::makeSegmentation(int* q, int len)
segmentation.segments.clear();
segmentation.nsegtypes = nclusters;
segmentation.samplerate = samplerate;
-
+
Segment segment;
segment.start = 0;
segment.type = q[0];
-
+
for (int i = 1; i < len; i++)
{
if (q[i] != q[i-1])
diff --git a/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.h b/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.h
index 528c09cb55..8f3130871e 100644
--- a/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.h
+++ b/libs/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.h
@@ -72,7 +72,7 @@ public:
protected:
void makeSegmentation(int* q, int len);
-
+
void extractFeaturesConstQ(const double *, int);
void extractFeaturesMFCC(const double *, int);
@@ -82,9 +82,9 @@ protected:
MFCC* mfcc;
model_t* model; // the HMM
int* q; // the decoded HMM state sequence
- vector<vector<double> > histograms;
+ vector<vector<double> > histograms;
- feature_types featureType;
+ feature_types featureType;
double hopSize; // in seconds
double windowSize; // in seconds
diff --git a/libs/qm-dsp/dsp/segmentation/Segmenter.cpp b/libs/qm-dsp/dsp/segmentation/Segmenter.cpp
index 120a6617f5..b60fb58162 100644
--- a/libs/qm-dsp/dsp/segmentation/Segmenter.cpp
+++ b/libs/qm-dsp/dsp/segmentation/Segmenter.cpp
@@ -19,13 +19,13 @@
ostream& operator<<(ostream& os, const Segmentation& s)
{
os << "structure_name : begin_time end_time\n";
-
+
for (int i = 0; i < s.segments.size(); i++)
{
Segment seg = s.segments[i];
os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate)
<< '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
}
-
+
return os;
}
diff --git a/libs/qm-dsp/dsp/segmentation/Segmenter.h b/libs/qm-dsp/dsp/segmentation/Segmenter.h
index 9a77d70372..fd2f39b850 100644
--- a/libs/qm-dsp/dsp/segmentation/Segmenter.h
+++ b/libs/qm-dsp/dsp/segmentation/Segmenter.h
@@ -35,7 +35,7 @@ class Segmentation
public:
int nsegtypes; // number of segment types, so possible types are {0,1,...,nsegtypes-1}
int samplerate;
- vector<Segment> segments;
+ vector<Segment> segments;
};
ostream& operator<<(ostream& os, const Segmentation& s);
diff --git a/libs/qm-dsp/dsp/segmentation/cluster_melt.c b/libs/qm-dsp/dsp/segmentation/cluster_melt.c
index 0509480807..092bc7f078 100644
--- a/libs/qm-dsp/dsp/segmentation/cluster_melt.c
+++ b/libs/qm-dsp/dsp/segmentation/cluster_melt.c
@@ -25,7 +25,7 @@ double kldist(double* a, double* b, int n) {
because a, b represent probability distributions */
double q, d;
int i;
-
+
d = 0;
for (i = 0; i < n; i++)
{
@@ -38,8 +38,8 @@ double kldist(double* a, double* b, int n) {
d += b[i] * log(b[i] / q);
}
}
- return d;
-}
+ return d;
+}
void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l, int *c) {
double lambda, sum, beta, logsumexp, maxlp;
@@ -48,9 +48,9 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
int** nc; /* neighbour counts for each histogram */
double** lp; /* soft assignment probs for each histogram */
int* oldc; /* previous hard assignments (to check convergence) */
-
+
/* NB h is passed as a 1d row major array */
-
+
/* parameter values */
lambda = DEFAULT_LAMBDA;
if (l > 0)
@@ -60,22 +60,22 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
B = 2 * limit + 1;
maxiter0 = 20; /* number of iterations at initial temperature */
maxiter1 = 5; /* number of iterations at subsequent temperatures */
-
- /* allocate memory */
+
+ /* allocate memory */
cl = (double**) malloc(k*sizeof(double*));
for (i= 0; i < k; i++)
cl[i] = (double*) malloc(m*sizeof(double));
-
+
nc = (int**) malloc(n*sizeof(int*));
for (i= 0; i < n; i++)
nc[i] = (int*) malloc(k*sizeof(int));
-
+
lp = (double**) malloc(n*sizeof(double*));
for (i= 0; i < n; i++)
lp[i] = (double*) malloc(k*sizeof(double));
-
+
oldc = (int*) malloc(n * sizeof(int));
-
+
/* initialise */
for (i = 0; i < k; i++)
{
@@ -90,40 +90,40 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
{
cl[i][j] /= sum; /* normalise */
}
- }
+ }
//print_array(cl, k, m);
-
+
for (i = 0; i < n; i++)
c[i] = 1; /* initially assign all histograms to cluster 1 */
-
+
for (a = 0; a < t; a++)
{
beta = Bsched[a];
-
+
if (a == 0)
maxiter = maxiter0;
else
maxiter = maxiter1;
-
+
for (it = 0; it < maxiter; it++)
{
//if (it == maxiter - 1)
// mexPrintf("hasn't converged after %d iterations\n", maxiter);
-
+
for (i = 0; i < n; i++)
{
/* save current hard assignments */
oldc[i] = c[i];
-
+
/* calculate soft assignment logprobs for each cluster */
sum = 0;
for (j = 0; j < k; j++)
{
lp[i][ j] = -beta * kldist(cl[j], &h[i*m], m);
-
+
/* update matching neighbour counts for this histogram, based on current hard assignments */
/* old version:
- nc[i][j] = 0;
+ nc[i][j] = 0;
if (i >= limit && i <= n - 1 - limit)
{
for (b = i - limit; b <= i + limit; b++)
@@ -144,14 +144,14 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
for (b = b0; b <= b1; b++)
if (c[b] == j+1)
nc[i][j]--;
-
+
sum += exp(lp[i][j]);
}
-
+
/* normalise responsibilities and add duration logprior */
logsumexp = log(sum);
for (j = 0; j < k; j++)
- lp[i][j] -= logsumexp + lambda * nc[i][j];
+ lp[i][j] -= logsumexp + lambda * nc[i][j];
}
//print_array(lp, n, k);
/*
@@ -162,8 +162,8 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
mexPrintf("\n");
}
*/
-
-
+
+
/* update the assignments now that we know the duration priors
based on the current assignments */
for (i = 0; i < n; i++)
@@ -177,14 +177,14 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
c[i] = j+1;
}
}
-
+
/* break if assignments haven't changed */
i = 0;
while (i < n && oldc[i] == c[i])
i++;
if (i == n)
break;
-
+
/* update reference histograms now we know new responsibilities */
for (j = 0; j < k; j++)
{
@@ -194,21 +194,21 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
for (i = 0; i < n; i++)
{
cl[j][b] += exp(lp[i][j]) * h[i*m+b];
- }
+ }
}
-
- sum = 0;
+
+ sum = 0;
for (i = 0; i < n; i++)
sum += exp(lp[i][j]);
for (b = 0; b < m; b++)
cl[j][b] /= sum; /* normalise */
- }
-
+ }
+
//print_array(cl, k, m);
//mexPrintf("\n\n");
}
}
-
+
/* free memory */
for (i = 0; i < k; i++)
free(cl[i]);
@@ -219,7 +219,7 @@ void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l,
for (i = 0; i < n; i++)
free(lp[i]);
free(lp);
- free(oldc);
+ free(oldc);
}
diff --git a/libs/qm-dsp/dsp/segmentation/cluster_segmenter.c b/libs/qm-dsp/dsp/segmentation/cluster_segmenter.c
index 0d2762ee7f..c9f115c205 100644
--- a/libs/qm-dsp/dsp/segmentation/cluster_segmenter.c
+++ b/libs/qm-dsp/dsp/segmentation/cluster_segmenter.c
@@ -25,7 +25,7 @@ void cq2chroma(double** cq, int nframes, int ncoeff, int bins, double** chroma)
int t, b, oct, ix;
//double maxchroma; /* max chroma value at each time, for normalisation */
//double sum; /* for normalisation */
-
+
for (t = 0; t < nframes; t++)
{
for (b = 0; b < bins; b++)
@@ -50,7 +50,7 @@ void cq2chroma(double** cq, int nframes, int ncoeff, int bins, double** chroma)
maxchroma = chroma[t][b];
if (maxchroma > 0)
for (b = 0; b < bins; b++)
- chroma[t][b] /= maxchroma;
+ chroma[t][b] /= maxchroma;
*/
}
}
@@ -62,13 +62,13 @@ void mpeg7_constq(double** features, int nframes, int ncoeff)
double ss;
double env;
double maxenv = 0;
-
+
/* convert const-Q features to dB scale */
for (i = 0; i < nframes; i++)
for (j = 0; j < ncoeff; j++)
features[i][j] = 10.0 * log10(features[i][j]+DBL_EPSILON);
-
- /* normalise each feature vector and add the norm as an extra feature dimension */
+
+ /* normalise each feature vector and add the norm as an extra feature dimension */
for (i = 0; i < nframes; i++)
{
ss = 0;
@@ -83,7 +83,7 @@ void mpeg7_constq(double** features, int nframes, int ncoeff)
}
/* normalise the envelopes */
for (i = 0; i < nframes; i++)
- features[i][ncoeff] /= maxenv;
+ features[i][ncoeff] /= maxenv;
}
/* return histograms h[nx*m] of data x[nx] into m bins using a sliding window of length h_len (MUST BE ODD) */
@@ -109,7 +109,7 @@ void create_histograms(int* x, int nx, int m, int hlen, double* h)
for (j = 0; j < m; j++)
h[i*m+j] /= norm;
}
-
+
/* duplicate histograms at beginning and end to create one histogram for each data value supplied */
for (i = 0; i < hlen/2; i++)
for (j = 0; j < m; j++)
@@ -124,7 +124,7 @@ void cluster_segment(int* q, double** features, int frames_read, int feature_len
int histogram_length, int nclusters, int neighbour_limit)
{
int i, j;
-
+
/*****************************/
if (0) {
/* try just using the predominant bin number as a 'decoded state' */
@@ -141,44 +141,44 @@ void cluster_segment(int* q, double** features, int frames_read, int feature_len
{
maxval = features[i][j];
maxbin = j;
- }
+ }
}
if (maxval > chroma_thresh)
q[i] = maxbin;
else
q[i] = feature_length;
}
-
+
}
if (1) {
/*****************************/
-
-
+
+
/* scale all the features to 'balance covariances' during HMM training */
double scale = 10;
for (i = 0; i < frames_read; i++)
for (j = 0; j < feature_length; j++)
features[i][j] *= scale;
-
+
/* train an HMM on the features */
-
+
/* create a model */
model_t* model = hmm_init(features, frames_read, feature_length, nHMM_states);
-
+
/* train the model */
hmm_train(features, frames_read, model);
-/*
+/*
printf("\n\nafter training:\n");
hmm_print(model);
-*/
+*/
/* decode the hidden state sequence */
viterbi_decode(features, frames_read, model, q);
hmm_close(model);
-
+
/*****************************/
}
/*****************************/
-
+
/*
fprintf(stderr, "HMM state sequence:\n");
@@ -186,11 +186,11 @@ void cluster_segment(int* q, double** features, int frames_read, int feature_len
fprintf(stderr, "%d ", q[i]);
fprintf(stderr, "\n\n");
*/
-
+
/* create histograms of states */
double* h = (double*) malloc(frames_read*nHMM_states*sizeof(double)); /* vector in row major order */
create_histograms(q, frames_read, nHMM_states, histogram_length, h);
-
+
/* cluster the histograms */
int nbsched = 20; /* length of inverse temperature schedule */
double* bsched = (double*) malloc(nbsched*sizeof(double)); /* inverse temperature schedule */
@@ -200,9 +200,9 @@ void cluster_segment(int* q, double** features, int frames_read, int feature_len
for (i = 1; i < nbsched; i++)
bsched[i] = alpha * bsched[i-1];
cluster_melt(h, nHMM_states, frames_read, bsched, nbsched, nclusters, neighbour_limit, q);
-
+
/* now q holds a sequence of cluster assignments */
-
+
free(h);
free(bsched);
}
@@ -214,25 +214,25 @@ void constq_segment(int* q, double** features, int frames_read, int bins, int nc
int feature_length;
double** chroma;
int i;
-
+
if (feature_type == FEATURE_TYPE_CONSTQ)
{
/* fprintf(stderr, "Converting to dB and normalising...\n");
- */
+ */
mpeg7_constq(features, frames_read, ncoeff);
-/*
+/*
fprintf(stderr, "Running PCA...\n");
-*/
+*/
/* do PCA on the features (but not the envelope) */
int ncomponents = 20;
pca_project(features, frames_read, ncoeff, ncomponents);
-
+
/* copy the envelope so that it immediatly follows the chosen components */
for (i = 0; i < frames_read; i++)
- features[i][ncomponents] = features[i][ncoeff];
-
+ features[i][ncomponents] = features[i][ncoeff];
+
feature_length = ncomponents + 1;
-
+
/**************************************
//TEST
// feature file name
@@ -241,7 +241,7 @@ void constq_segment(int* q, double** features, int frames_read, int bins, int nc
strcpy(file_name, dir);
strcat(file_name, trackname);
strcat(file_name, "_features_c20r8h0.2f0.6.mat");
-
+
// get the features from Matlab from mat-file
int frames_in_file;
readmatarray_size(file_name, 2, &frames_in_file, &feature_length);
@@ -254,27 +254,27 @@ void constq_segment(int* q, double** features, int frames_read, int bins, int nc
features[frames_read-missing_frames][i] = features[frames_read-missing_frames-1][i];
--missing_frames;
}
-
+
free(file_name);
******************************************/
-
+
cluster_segment(q, features, frames_read, feature_length, nHMM_states, histogram_length, nclusters, neighbour_limit);
}
-
+
if (feature_type == FEATURE_TYPE_CHROMA)
{
/*
fprintf(stderr, "Converting to chroma features...\n");
-*/
+*/
/* convert constant-Q to normalised chroma features */
chroma = (double**) malloc(frames_read*sizeof(double*));
for (i = 0; i < frames_read; i++)
chroma[i] = (double*) malloc(bins*sizeof(double));
cq2chroma(features, frames_read, ncoeff, bins, chroma);
feature_length = bins;
-
+
cluster_segment(q, chroma, frames_read, feature_length, nHMM_states, histogram_length, nclusters, neighbour_limit);
-
+
for (i = 0; i < frames_read; i++)
free(chroma[i]);
free(chroma);
diff --git a/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp b/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp
index 971f5fac8e..4b93cb0e12 100644
--- a/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp
+++ b/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp
@@ -25,7 +25,7 @@
DFProcess::DFProcess( DFProcConfig Config )
{
filtSrc = NULL;
- filtDst = NULL;
+ filtDst = NULL;
m_filtScratchIn = NULL;
m_filtScratchOut = NULL;
@@ -51,13 +51,13 @@ void DFProcess::initialise( DFProcConfig Config )
filtSrc = new double[ m_length ];
filtDst = new double[ m_length ];
-
+
//Low Pass Smoothing Filter Config
m_FilterConfigParams.ord = Config.LPOrd;
m_FilterConfigParams.ACoeffs = Config.LPACoeffs;
m_FilterConfigParams.BCoeffs = Config.LPBCoeffs;
-
- m_FiltFilt = new FiltFilt( m_FilterConfigParams );
+
+ m_FiltFilt = new FiltFilt( m_FilterConfigParams );
}
void DFProcess::deInitialise()
@@ -115,7 +115,7 @@ void DFProcess::medianFilter(double *src, double *dst)
{
if (index >= m_length) break;
-
+
l = 0;
for( j = i; j < ( i + m_winPost + m_winPre + 1); j++)
{
@@ -139,7 +139,7 @@ void DFProcess::medianFilter(double *src, double *dst)
l++;
}
-
+
scratch[ index++ ] = MathUtilities::median( y, l);
}
@@ -147,7 +147,7 @@ void DFProcess::medianFilter(double *src, double *dst)
for( i = 0; i < m_length; i++ )
{
val = src[ i ] - scratch[ i ];// - 0.033;
-
+
if( m_isMedianPositive )
{
if( val > 0 )
@@ -164,7 +164,7 @@ void DFProcess::medianFilter(double *src, double *dst)
dst[ i ] = val;
}
}
-
+
delete [] y;
delete [] scratch;
}
diff --git a/libs/qm-dsp/dsp/signalconditioning/DFProcess.h b/libs/qm-dsp/dsp/signalconditioning/DFProcess.h
index 3af80743f5..ad40f846b9 100644
--- a/libs/qm-dsp/dsp/signalconditioning/DFProcess.h
+++ b/libs/qm-dsp/dsp/signalconditioning/DFProcess.h
@@ -38,7 +38,7 @@ public:
void process( double* src, double* dst );
-
+
private:
void initialise( DFProcConfig Config );
void deInitialise();
diff --git a/libs/qm-dsp/dsp/signalconditioning/FiltFilt.cpp b/libs/qm-dsp/dsp/signalconditioning/FiltFilt.cpp
index 5a9e2c9549..13dbda0e82 100644
--- a/libs/qm-dsp/dsp/signalconditioning/FiltFilt.cpp
+++ b/libs/qm-dsp/dsp/signalconditioning/FiltFilt.cpp
@@ -24,7 +24,7 @@ FiltFilt::FiltFilt( FiltFiltConfig Config )
m_filtScratchIn = NULL;
m_filtScratchOut = NULL;
m_ord = 0;
-
+
initialise( Config );
}
@@ -39,7 +39,7 @@ void FiltFilt::initialise( FiltFiltConfig Config )
m_filterConfig.ord = Config.ord;
m_filterConfig.ACoeffs = Config.ACoeffs;
m_filterConfig.BCoeffs = Config.BCoeffs;
-
+
m_filter = new Filter( m_filterConfig );
}
@@ -50,7 +50,7 @@ void FiltFilt::deInitialise()
void FiltFilt::process(double *src, double *dst, unsigned int length)
-{
+{
unsigned int i;
if (length == 0) return;
@@ -62,7 +62,7 @@ void FiltFilt::process(double *src, double *dst, unsigned int length)
m_filtScratchIn = new double[ nExt ];
m_filtScratchOut = new double[ nExt ];
-
+
for( i = 0; i< nExt; i++ )
{
m_filtScratchIn[ i ] = 0.0;
@@ -89,11 +89,11 @@ void FiltFilt::process(double *src, double *dst, unsigned int length)
{
m_filtScratchIn[ i + nFact ] = src[ i ];
}
-
+
////////////////////////////////
// Do 0Ph filtering
m_filter->process( m_filtScratchIn, m_filtScratchOut, nExt);
-
+
// reverse the series for FILTFILT
for ( i = 0; i < nExt; i++)
{
@@ -102,7 +102,7 @@ void FiltFilt::process(double *src, double *dst, unsigned int length)
// do FILTER again
m_filter->process( m_filtScratchIn, m_filtScratchOut, nExt);
-
+
// reverse the series back
for ( i = 0; i < nExt; i++)
{
@@ -117,7 +117,7 @@ void FiltFilt::process(double *src, double *dst, unsigned int length)
for( i = 0; i < length; i++ )
{
dst[ index++ ] = m_filtScratchOut[ i + nFact ];
- }
+ }
delete [] m_filtScratchIn;
delete [] m_filtScratchOut;
diff --git a/libs/qm-dsp/dsp/signalconditioning/Filter.h b/libs/qm-dsp/dsp/signalconditioning/Filter.h
index 8533ed0502..b1c20d506a 100644
--- a/libs/qm-dsp/dsp/signalconditioning/Filter.h
+++ b/libs/qm-dsp/dsp/signalconditioning/Filter.h
@@ -35,7 +35,7 @@ public:
void reset();
void process( double *src, double *dst, unsigned int length );
-
+
private:
void initialise( FilterConfig Config );
diff --git a/libs/qm-dsp/dsp/signalconditioning/Framer.cpp b/libs/qm-dsp/dsp/signalconditioning/Framer.cpp
index 80ea67f72c..7357d2417a 100644
--- a/libs/qm-dsp/dsp/signalconditioning/Framer.cpp
+++ b/libs/qm-dsp/dsp/signalconditioning/Framer.cpp
@@ -44,14 +44,14 @@ void Framer::configure( unsigned int frameLength, unsigned int hop )
if( m_dataFrame != NULL )
{
- delete [] m_dataFrame;
+ delete [] m_dataFrame;
m_dataFrame = NULL;
}
m_dataFrame = new double[ m_frameLength ];
if( m_strideFrame != NULL )
{
- delete [] m_strideFrame;
+ delete [] m_strideFrame;
m_strideFrame = NULL;
}
m_strideFrame = new double[ m_stepSize ];
@@ -65,7 +65,7 @@ void Framer::getFrame(double *dst)
for( unsigned int u = 0; u < m_frameLength; u++)
{
dst[ u ] = m_srcBuffer[ m_ulSrcIndex++ ];
- }
+ }
m_ulSrcIndex -= ( m_frameLength - m_stepSize );
}
else
@@ -77,7 +77,7 @@ void Framer::getFrame(double *dst)
{
dst[ u ] = m_srcBuffer[ m_ulSrcIndex++ ];
}
-
+
for( unsigned int u = 0; u < zero; u++ )
{
dst[ rem + u ] = 0;
diff --git a/libs/qm-dsp/dsp/tempotracking/DownBeat.cpp b/libs/qm-dsp/dsp/tempotracking/DownBeat.cpp
index b2183b51ed..1167bc6ea9 100644
--- a/libs/qm-dsp/dsp/tempotracking/DownBeat.cpp
+++ b/libs/qm-dsp/dsp/tempotracking/DownBeat.cpp
@@ -293,7 +293,7 @@ DownBeat::measureSpecDiff(d_vec_t oldspec, d_vec_t newspec)
}
// JENSEN-SHANNON CALCULATION
- sd1 = 0.5*oldspec[i] + 0.5*newspec[i];
+ sd1 = 0.5*oldspec[i] + 0.5*newspec[i];
SD = SD + (-sd1*log(sd1)) + (0.5*(oldspec[i]*log(oldspec[i]))) + (0.5*(newspec[i]*log(newspec[i])));
}
diff --git a/libs/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp b/libs/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp
index acaa8ff7cd..a2c2a24b0a 100644
--- a/libs/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp
+++ b/libs/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp
@@ -177,7 +177,7 @@ TempoTrackV2::get_rcf(const d_vec_t &dfframe_in, const d_vec_t &wv, d_vec_t &rcf
// now apply comb filtering
int numelem = 4;
-
+
for (unsigned int i = 2;i < rcf.size();i++) // max beat period
{
for (int a = 1;a <= numelem;a++) // number of comb elements
@@ -218,7 +218,7 @@ TempoTrackV2::viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &
{
tmat.push_back ( d_vec_t() ); // adds a new column
for (unsigned int j=0; j<wv.size(); j++)
- {
+ {
tmat[i].push_back(0.); // fill with zeros initially
}
}
@@ -230,7 +230,7 @@ TempoTrackV2::viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &
for (unsigned int i=20;i <wv.size()-20; i++)
{
for (unsigned int j=20; j<wv.size()-20; j++)
- {
+ {
double mu = static_cast<double>(i);
tmat[i][j] = exp( (-1.*pow((j-mu),2.)) / (2.*pow(sigma,2.)) );
}
@@ -246,7 +246,7 @@ TempoTrackV2::viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv, d_vec_t &
delta.push_back( d_vec_t());
psi.push_back( i_vec_t());
for (unsigned int j=0; j<rcfmat[i].size(); j++)
- {
+ {
delta[i].push_back(0.); // fill with zeros initially
psi[i].push_back(0); // fill with zeros initially
}
diff --git a/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp b/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp
index bcc661dd1d..a572da6ee8 100644
--- a/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp
+++ b/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp
@@ -34,20 +34,20 @@ ChangeDetectionFunction::~ChangeDetectionFunction()
void ChangeDetectionFunction::setFilterWidth(const int iWidth)
{
m_iFilterWidth = iWidth*2+1;
-
+
// it is assumed that the gaussian is 0 outside of +/- FWHM
// => filter width = 2*FWHM = 2*2.3548*sigma
m_dFilterSigma = double(m_iFilterWidth) / double(2*2.3548);
m_vaGaussian.resize(m_iFilterWidth);
-
+
double dScale = 1.0 / (m_dFilterSigma*sqrt(2*PI));
-
+
for (int x = -(m_iFilterWidth-1)/2; x <= (m_iFilterWidth-1)/2; x++)
{
double w = dScale * std::exp ( -(x*x)/(2*m_dFilterSigma*m_dFilterSigma) );
m_vaGaussian[x + (m_iFilterWidth-1)/2] = w;
}
-
+
#ifdef DEBUG_CHANGE_DETECTION_FUNCTION
std::cerr << "Filter sigma: " << m_dFilterSigma << std::endl;
std::cerr << "Filter width: " << m_iFilterWidth << std::endl;
@@ -59,37 +59,37 @@ ChangeDistance ChangeDetectionFunction::process(const TCSGram& rTCSGram)
{
ChangeDistance retVal;
retVal.resize(rTCSGram.getSize(), 0.0);
-
+
TCSGram smoothedTCSGram;
for (int iPosition = 0; iPosition < rTCSGram.getSize(); iPosition++)
{
int iSkipLower = 0;
-
+
int iLowerPos = iPosition - (m_iFilterWidth-1)/2;
int iUpperPos = iPosition + (m_iFilterWidth-1)/2;
-
+
if (iLowerPos < 0)
{
iSkipLower = -iLowerPos;
iLowerPos = 0;
}
-
+
if (iUpperPos >= rTCSGram.getSize())
{
int iMaxIndex = rTCSGram.getSize() - 1;
iUpperPos = iMaxIndex;
}
-
+
TCSVector smoothedVector;
// for every bin of the vector, calculate the smoothed value
for (int iPC = 0; iPC < 6; iPC++)
- {
+ {
size_t j = 0;
double dSmoothedValue = 0.0;
TCSVector rCV;
-
+
for (int i = iLowerPos; i <= iUpperPos; i++)
{
rTCSGram.getTCSVector(i, rCV);
@@ -98,7 +98,7 @@ ChangeDistance ChangeDetectionFunction::process(const TCSGram& rTCSGram)
smoothedVector[iPC] = dSmoothedValue;
}
-
+
smoothedTCSGram.addTCSVector(smoothedVector);
}
@@ -109,10 +109,10 @@ ChangeDistance ChangeDetectionFunction::process(const TCSGram& rTCSGram)
if the current estimate is not confident enough, look further into the future/the past
e.g., High frequency content, zero crossing rate, spectral flatness
*/
-
+
TCSVector nextTCS;
TCSVector previousTCS;
-
+
int iWindow = 1;
// while (previousTCS.magnitude() < 0.1 && (iPosition-iWindow) > 0)
@@ -121,9 +121,9 @@ ChangeDistance ChangeDetectionFunction::process(const TCSGram& rTCSGram)
// std::cout << previousTCS.magnitude() << std::endl;
iWindow++;
}
-
+
iWindow = 1;
-
+
// while (nextTCS.magnitude() < 0.1 && (iPosition+iWindow) < (rTCSGram.getSize()-1) )
{
smoothedTCSGram.getTCSVector(iPosition+iWindow, nextTCS);
@@ -136,7 +136,7 @@ ChangeDistance ChangeDetectionFunction::process(const TCSGram& rTCSGram)
{
distance += std::pow(nextTCS[j] - previousTCS[j], 2.0);
}
-
+
retVal[iPosition] = std::pow(distance, 0.5);
}
diff --git a/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.h b/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.h
index 3a84b3096f..5d041ad769 100644
--- a/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.h
+++ b/libs/qm-dsp/dsp/tonal/ChangeDetectionFunction.h
@@ -38,7 +38,7 @@ public:
ChangeDistance process(const TCSGram& rTCSGram);
private:
void setFilterWidth(const int iWidth);
-
+
private:
valarray<double> m_vaGaussian;
double m_dFilterSigma;
diff --git a/libs/qm-dsp/dsp/tonal/TCSgram.cpp b/libs/qm-dsp/dsp/tonal/TCSgram.cpp
index c226c81402..954ba03e9b 100644
--- a/libs/qm-dsp/dsp/tonal/TCSgram.cpp
+++ b/libs/qm-dsp/dsp/tonal/TCSgram.cpp
@@ -55,7 +55,7 @@ void TCSGram::addTCSVector(const TCSVector& rTCSVector)
std::pair<long, TCSVector> p;
p.first = lMilliSeconds;
p.second = rTCSVector;
-
+
m_VectorList.push_back(p);
}
@@ -68,7 +68,7 @@ long TCSGram::getDuration() const
void TCSGram::printDebug()
{
vectorlist_t::iterator vectorIterator = m_VectorList.begin();
-
+
while (vectorIterator != m_VectorList.end())
{
vectorIterator->second.printDebug();
diff --git a/libs/qm-dsp/dsp/tonal/TCSgram.h b/libs/qm-dsp/dsp/tonal/TCSgram.h
index 83e8c93f8b..f4825a996a 100644
--- a/libs/qm-dsp/dsp/tonal/TCSgram.h
+++ b/libs/qm-dsp/dsp/tonal/TCSgram.h
@@ -26,7 +26,7 @@ typedef std::vector<std::pair<long, TCSVector> > vectorlist_t;
class TCSGram
{
-public:
+public:
TCSGram();
~TCSGram();
void getTCSVector(int, TCSVector&) const;
diff --git a/libs/qm-dsp/dsp/tonal/TonalEstimator.cpp b/libs/qm-dsp/dsp/tonal/TonalEstimator.cpp
index 16d1aa8995..72b6f85c83 100644
--- a/libs/qm-dsp/dsp/tonal/TonalEstimator.cpp
+++ b/libs/qm-dsp/dsp/tonal/TonalEstimator.cpp
@@ -27,15 +27,15 @@ TonalEstimator::TonalEstimator()
m_Basis.resize(6);
int i = 0;
-
-
+
+
// circle of fifths
m_Basis[i].resize(12);
for (int iP = 0; iP < 12; iP++)
{
m_Basis[i][iP] = std::sin( (7.0 / 6.0) * iP * PI);
}
-
+
i++;
m_Basis[i].resize(12);
@@ -43,17 +43,17 @@ TonalEstimator::TonalEstimator()
{
m_Basis[i][iP] = std::cos( (7.0 / 6.0) * iP * PI);
}
-
+
i++;
-
-
+
+
// circle of major thirds
m_Basis[i].resize(12);
for (int iP = 0; iP < 12; iP++)
{
m_Basis[i][iP] = 0.6 * std::sin( (2.0 / 3.0) * iP * PI);
}
-
+
i++;
m_Basis[i].resize(12);
@@ -71,7 +71,7 @@ TonalEstimator::TonalEstimator()
{
m_Basis[i][iP] = 1.1 * std::sin( (3.0 / 2.0) * iP * PI);
}
-
+
i++;
m_Basis[i].resize(12);
@@ -90,7 +90,7 @@ TCSVector TonalEstimator::transform2TCS(const ChromaVector& rVector)
{
TCSVector vaRetVal;
vaRetVal.resize(6, 0.0);
-
+
for (int i = 0; i < 6; i++)
{
for (int iP = 0; iP < 12; iP++)
@@ -98,6 +98,6 @@ TCSVector TonalEstimator::transform2TCS(const ChromaVector& rVector)
vaRetVal[i] += m_Basis[i][iP] * rVector[iP];
}
}
-
+
return vaRetVal;
}
diff --git a/libs/qm-dsp/dsp/tonal/TonalEstimator.h b/libs/qm-dsp/dsp/tonal/TonalEstimator.h
index 5753dff050..cfb8bba5b6 100644
--- a/libs/qm-dsp/dsp/tonal/TonalEstimator.h
+++ b/libs/qm-dsp/dsp/tonal/TonalEstimator.h
@@ -27,24 +27,24 @@ class ChromaVector : public std::valarray<double>
public:
ChromaVector(size_t uSize = 12) : std::valarray<double>()
{ resize(uSize, 0.0f); }
-
+
virtual ~ChromaVector() {};
-
+
void printDebug()
{
for (int i = 0; i < size(); i++)
{
std::cout << (*this)[i] << ";";
}
-
+
std::cout << std::endl;
}
-
+
void normalizeL1()
{
// normalize the chroma vector (L1 norm)
double dSum = 0.0;
-
+
for (size_t i = 0; i < 12; (dSum += std::abs((*this)[i++]))) ;
for (size_t i = 0; i < 12; dSum > 0.0000001?((*this)[i] /= dSum):(*this)[i]=0.0, i++) ;
@@ -55,7 +55,7 @@ public:
for (size_t i = 0; i < 12; ++i) (*this)[i] = 0.0;
}
-
+
};
class TCSVector : public std::valarray<double>
@@ -63,7 +63,7 @@ class TCSVector : public std::valarray<double>
public:
TCSVector() : std::valarray<double>()
{ resize(6, 0.0f); }
-
+
virtual ~TCSVector() {};
void printDebug()
@@ -72,19 +72,19 @@ public:
{
std::cout << (*this)[i] << ";";
}
-
+
std::cout << std::endl;
}
-
+
double magnitude() const
{
double dMag = 0.0;
-
+
for (size_t i = 0; i < 6; i++)
{
dMag += std::pow((*this)[i], 2.0);
}
-
+
return std::sqrt(dMag);
}
diff --git a/libs/qm-dsp/dsp/transforms/FFT.cpp b/libs/qm-dsp/dsp/transforms/FFT.cpp
index 454cfb1422..0ca618f40b 100644
--- a/libs/qm-dsp/dsp/transforms/FFT.cpp
+++ b/libs/qm-dsp/dsp/transforms/FFT.cpp
@@ -54,7 +54,7 @@ FFTReal::process(bool inverse,
}
static unsigned int numberOfBitsNeeded(unsigned int p_nSamples)
-{
+{
int i;
if( p_nSamples < 2 )
diff --git a/libs/qm-dsp/dsp/wavelet/Wavelet.cpp b/libs/qm-dsp/dsp/wavelet/Wavelet.cpp
index d3e1fa1baf..57d6337719 100644
--- a/libs/qm-dsp/dsp/wavelet/Wavelet.cpp
+++ b/libs/qm-dsp/dsp/wavelet/Wavelet.cpp
@@ -82,7 +82,7 @@ Wavelet::createDecompositionFilters(Type wavelet,
hpd.clear();
unsigned int flength = 0;
-
+
switch (wavelet) {
case Haar:
@@ -103,7 +103,7 @@ Wavelet::createDecompositionFilters(Type wavelet,
hpd.push_back(-0.22414386804186);
hpd.push_back(-0.12940952255092);
flength = 4;
- break;
+ break;
case Daubechies_3:
lpd.push_back(0.03522629188210);
@@ -592,7 +592,7 @@ Wavelet::createDecompositionFilters(Type wavelet,
hpd.push_back(-0.00000000000000);
flength = 80;
break;
-
+
case Symlet_2:
lpd.push_back(-0.12940952255092);
lpd.push_back(0.22414386804186);
@@ -692,7 +692,7 @@ Wavelet::createDecompositionFilters(Type wavelet,
hpd.push_back(0.01540410932703);
flength = 12;
break;
-
+
case Symlet_7:
lpd.push_back(0.00268181456826);
lpd.push_back(-0.00104738488868);
diff --git a/libs/qm-dsp/hmm/hmm.c b/libs/qm-dsp/hmm/hmm.c
index 69eee02b66..6642e4e1db 100644
--- a/libs/qm-dsp/hmm/hmm.c
+++ b/libs/qm-dsp/hmm/hmm.c
@@ -46,11 +46,11 @@ model_t* hmm_init(double** x, int T, int L, int N)
{
int i, j, d, e, t;
double s, ss;
-
+
model_t* model;
model = (model_t*) malloc(sizeof(model_t));
model->N = N;
- model->L = L;
+ model->L = L;
model->p0 = (double*) malloc(N*sizeof(double));
model->a = (double**) malloc(N*sizeof(double*));
model->mu = (double**) malloc(N*sizeof(double*));
@@ -62,10 +62,10 @@ model_t* hmm_init(double** x, int T, int L, int N)
model->cov = (double**) malloc(L*sizeof(double*));
for (i = 0; i < L; i++)
model->cov[i] = (double*) malloc(L*sizeof(double));
-
+
srand(time(0));
double* global_mean = (double*) malloc(L*sizeof(double));
-
+
/* find global mean */
for (d = 0; d < L; d++)
{
@@ -74,7 +74,7 @@ model_t* hmm_init(double** x, int T, int L, int N)
global_mean[d] += x[t][d];
global_mean[d] /= T;
}
-
+
/* calculate global diagonal covariance */
for (d = 0; d < L; d++)
{
@@ -84,7 +84,7 @@ model_t* hmm_init(double** x, int T, int L, int N)
model->cov[d][d] += (x[t][d] - global_mean[d]) * (x[t][d] - global_mean[d]);
model->cov[d][d] /= T-1;
}
-
+
/* set all means close to global mean */
for (i = 0; i < N; i++)
{
@@ -94,8 +94,8 @@ model_t* hmm_init(double** x, int T, int L, int N)
/* ideally the random number would be Gaussian(0,1), as a hack we make it uniform on [-0.25,0.25] */
model->mu[i][d] = global_mean[d] + (0.5 * rand() / (double) RAND_MAX - 0.25) * sqrt(model->cov[d][d]);
}
- }
-
+ }
+
/* random intial and transition probs */
s = 0;
for (i = 0; i < N; i++)
@@ -115,16 +115,16 @@ model_t* hmm_init(double** x, int T, int L, int N)
}
for (i = 0; i < N; i++)
model->p0[i] /= s;
-
+
free(global_mean);
-
+
return model;
}
void hmm_close(model_t* model)
{
int i;
-
+
for (i = 0; i < model->N; i++)
{
free(model->a[i]);
@@ -134,23 +134,23 @@ void hmm_close(model_t* model)
free(model->mu);
for (i = 0; i < model->L; i++)
free(model->cov[i]);
- free(model->cov);
- free(model);
+ free(model->cov);
+ free(model);
}
void hmm_train(double** x, int T, model_t* model)
{
int i, t;
double loglik; /* overall log-likelihood at each iteration */
-
+
int N = model->N;
int L = model->L;
double* p0 = model->p0;
double** a = model->a;
double** mu = model->mu;
double** cov = model->cov;
-
- /* allocate memory */
+
+ /* allocate memory */
double** gamma = (double**) malloc(T*sizeof(double*));
double*** xi = (double***) malloc(T*sizeof(double**));
for (t = 0; t < T; t++)
@@ -160,45 +160,45 @@ void hmm_train(double** x, int T, model_t* model)
for (i = 0; i < N; i++)
xi[t][i] = (double*) malloc(N*sizeof(double));
}
-
+
/* temporary memory */
double* gauss_y = (double*) malloc(L*sizeof(double));
- double* gauss_z = (double*) malloc(L*sizeof(double));
-
+ double* gauss_z = (double*) malloc(L*sizeof(double));
+
/* obs probs P(j|{x}) */
double** b = (double**) malloc(T*sizeof(double*));
for (t = 0; t < T; t++)
b[t] = (double*) malloc(N*sizeof(double));
-
+
/* inverse covariance and its determinant */
double** icov = (double**) malloc(L*sizeof(double*));
for (i = 0; i < L; i++)
icov[i] = (double*) malloc(L*sizeof(double));
double detcov;
-
+
double thresh = 0.0001;
- int niter = 50;
+ int niter = 50;
int iter = 0;
double loglik1, loglik2;
int foundnan = 0;
- while (iter < niter && !foundnan && !(iter > 1 && (loglik - loglik1) < thresh * (loglik1 - loglik2)))
+ while (iter < niter && !foundnan && !(iter > 1 && (loglik - loglik1) < thresh * (loglik1 - loglik2)))
{
++iter;
-/*
+/*
fprintf(stderr, "calculating obsprobs...\n");
fflush(stderr);
-*/
+*/
/* precalculate obs probs */
invert(cov, L, icov, &detcov);
-
+
for (t = 0; t < T; t++)
{
//int allzero = 1;
for (i = 0; i < N; i++)
{
b[t][i] = exp(loggauss(x[t], L, mu[i], icov, detcov, gauss_y, gauss_z));
-
+
//if (b[t][i] != 0)
// allzero = 0;
}
@@ -213,13 +213,13 @@ void hmm_train(double** x, int T, model_t* model)
}
*/
}
-/*
+/*
fprintf(stderr, "forwards-backwards...\n");
fflush(stderr);
-*/
+*/
forward_backwards(xi, gamma, &loglik, &loglik1, &loglik2, iter, N, T, p0, a, b);
-/*
- fprintf(stderr, "iteration %d: loglik = %f\n", iter, loglik);
+/*
+ fprintf(stderr, "iteration %d: loglik = %f\n", iter, loglik);
fprintf(stderr, "re-estimation...\n");
fflush(stderr);
*/
@@ -227,9 +227,9 @@ void hmm_train(double** x, int T, model_t* model)
foundnan = 1;
continue;
}
-
+
baum_welch(p0, a, mu, cov, N, T, L, x, xi, gamma);
-
+
/*
printf("a:\n");
for (i = 0; i < model->N; i++)
@@ -242,7 +242,7 @@ void hmm_train(double** x, int T, model_t* model)
*/
//hmm_print(model);
}
-
+
/* deallocate memory */
for (t = 0; t < T; t++)
{
@@ -254,12 +254,12 @@ void hmm_train(double** x, int T, model_t* model)
}
free(gamma);
free(xi);
- free(b);
-
+ free(b);
+
for (i = 0; i < L; i++)
free(icov[i]);
free(icov);
-
+
free(gauss_y);
free(gauss_z);
}
@@ -267,27 +267,27 @@ void hmm_train(double** x, int T, model_t* model)
void mlss_reestimate(double* p0, double** a, double** mu, double** cov, int N, int T, int L, int* q, double** x)
{
/* fit a single Gaussian to observations in each state */
-
+
/* calculate the mean observation in each state */
-
+
/* calculate the overall covariance */
-
+
/* count transitions */
-
+
/* estimate initial probs from transitions (???) */
}
void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T, int L, double** x, double*** xi, double** gamma)
{
int i, j, t;
-
+
double* sum_gamma = (double*) malloc(N*sizeof(double));
-
+
/* temporary memory */
double* u = (double*) malloc(L*L*sizeof(double));
double* yy = (double*) malloc(T*L*sizeof(double));
- double* yy2 = (double*) malloc(T*L*sizeof(double));
-
+ double* yy2 = (double*) malloc(T*L*sizeof(double));
+
/* re-estimate transition probs */
for (i = 0; i < N; i++)
{
@@ -295,7 +295,7 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
for (t = 0; t < T-1; t++)
sum_gamma[i] += gamma[t][i];
}
-
+
for (i = 0; i < N; i++)
{
if (sum_gamma[i] == 0)
@@ -310,7 +310,7 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
for (t = 0; t < T-1; t++)
a[i][j] += xi[t][i][j];
//s += a[i][j];
- a[i][j] /= sum_gamma[i];
+ a[i][j] /= sum_gamma[i];
}
/*
for (j = 0; j < N; j++)
@@ -319,21 +319,21 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
}
*/
}
-
+
/* NB: now we need to sum gamma over all t */
for (i = 0; i < N; i++)
sum_gamma[i] += gamma[T-1][i];
-
+
/* re-estimate initial probs */
for (i = 0; i < N; i++)
p0[i] = gamma[0][i];
-
+
/* re-estimate covariance */
int d, e;
double sum_sum_gamma = 0;
for (i = 0; i < N; i++)
- sum_sum_gamma += sum_gamma[i];
-
+ sum_sum_gamma += sum_gamma[i];
+
/*
for (d = 0; d < L; d++)
{
@@ -343,9 +343,9 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
for (t = 0; t < T; t++)
for (j = 0; j < N; j++)
cov[d][e] += gamma[t][j] * (x[t][d] - mu[j][d]) * (x[t][e] - mu[j][e]);
-
+
cov[d][e] /= sum_sum_gamma;
-
+
if (ISNAN(cov[d][e]))
{
printf("cov[%d][%d] was nan\n", d, e);
@@ -365,12 +365,12 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
for (e = 0; e < d; e++)
cov[d][e] = cov[e][d];
*/
-
+
/* using BLAS */
for (d = 0; d < L; d++)
for (e = 0; e < L; e++)
cov[d][e] = 0;
-
+
for (j = 0; j < N; j++)
{
for (d = 0; d < L; d++)
@@ -379,20 +379,20 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
yy[d*T+t] = x[t][d] - mu[j][d];
yy2[d*T+t] = gamma[t][j] * (x[t][d] - mu[j][d]);
}
-
+
cblas_dgemm(CblasColMajor, CblasTrans, CblasNoTrans, L, L, T, 1.0, yy, T, yy2, T, 0, u, L);
-
+
for (e = 0; e < L; e++)
for (d = 0; d < L; d++)
cov[d][e] += u[e*L+d];
}
-
+
for (d = 0; d < L; d++)
for (e = 0; e < L; e++)
- cov[d][e] /= T; /* sum_sum_gamma; */
-
+ cov[d][e] /= T; /* sum_sum_gamma; */
+
//printf("sum_sum_gamma = %f\n", sum_sum_gamma); /* fine, = T IS THIS ALWAYS TRUE with pooled cov?? */
-
+
/* re-estimate means */
for (j = 0; j < N; j++)
{
@@ -404,7 +404,7 @@ void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T,
mu[j][d] /= sum_gamma[j];
}
}
-
+
/* deallocate memory */
free(sum_gamma);
free(yy);
@@ -416,7 +416,7 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
{
/* forwards-backwards with scaling */
int i, j, t;
-
+
double** alpha = (double**) malloc(T*sizeof(double*));
double** beta = (double**) malloc(T*sizeof(double*));
for (t = 0; t < T; t++)
@@ -424,34 +424,34 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
alpha[t] = (double*) malloc(N*sizeof(double));
beta[t] = (double*) malloc(N*sizeof(double));
}
-
+
/* scaling coefficients */
double* c = (double*) malloc(T*sizeof(double));
-
+
/* calculate forward probs and scale coefficients */
c[0] = 0;
for (i = 0; i < N; i++)
{
alpha[0][i] = p0[i] * b[0][i];
c[0] += alpha[0][i];
-
+
//printf("p0[%d] = %f, b[0][%d] = %f\n", i, p0[i], i, b[0][i]);
}
c[0] = 1 / c[0];
for (i = 0; i < N; i++)
{
- alpha[0][i] *= c[0];
-
+ alpha[0][i] *= c[0];
+
//printf("alpha[0][%d] = %f\n", i, alpha[0][i]); /* OK agrees with Matlab */
}
-
+
*loglik1 = *loglik;
*loglik = -log(c[0]);
if (iter == 2)
*loglik2 = *loglik;
-
+
for (t = 1; t < T; t++)
- {
+ {
c[t] = 0;
for (j = 0; j < N; j++)
{
@@ -459,10 +459,10 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
for (i = 0; i < N; i++)
alpha[t][j] += alpha[t-1][i] * a[i][j];
alpha[t][j] *= b[t][j];
-
+
c[t] += alpha[t][j];
}
-
+
/*
if (c[t] == 0)
{
@@ -477,16 +477,16 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
exit(-1);
}
*/
-
+
c[t] = 1 / c[t];
for (j = 0; j < N; j++)
alpha[t][j] *= c[t];
-
+
//printf("c[%d] = %e\n", t, c[t]);
-
+
*loglik -= log(c[t]);
}
-
+
/* calculate backwards probs using same coefficients */
for (i = 0; i < N; i++)
beta[T-1][i] = 1;
@@ -495,20 +495,20 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
{
for (i = 0; i < N; i++)
beta[t][i] *= c[t];
-
+
if (t == 0)
break;
-
+
for (i = 0; i < N; i++)
{
beta[t-1][i] = 0;
for (j = 0; j < N; j++)
beta[t-1][i] += a[i][j] * b[t][j] * beta[t][j];
}
-
+
t--;
}
-
+
/*
printf("alpha:\n");
for (t = 0; t < T; t++)
@@ -526,7 +526,7 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
}
printf("\n\n");
*/
-
+
/* calculate posterior probs */
double tot;
for (t = 0; t < T; t++)
@@ -539,12 +539,12 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
}
for (i = 0; i < N; i++)
{
- gamma[t][i] /= tot;
-
- //printf("gamma[%d][%d] = %f\n", t, i, gamma[t][i]);
+ gamma[t][i] /= tot;
+
+ //printf("gamma[%d][%d] = %f\n", t, i, gamma[t][i]);
}
- }
-
+ }
+
for (t = 0; t < T-1; t++)
{
tot = 0;
@@ -560,7 +560,7 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
for (j = 0; j < N; j++)
xi[t][i][j] /= tot;
}
-
+
/*
// CHECK - fine
// gamma[t][i] = \sum_j{xi[t][i][j]}
@@ -568,8 +568,8 @@ void forward_backwards(double*** xi, double** gamma, double* loglik, double* log
for (j = 0; j < N; j++)
tot += xi[3][1][j];
printf("gamma[3][1] = %f, sum_j(xi[3][1][j]) = %f\n", gamma[3][1], tot);
- */
-
+ */
+
for (t = 0; t < T; t++)
{
free(alpha[t]);
@@ -585,20 +585,20 @@ void viterbi_decode(double** x, int T, model_t* model, int* q)
int i, j, t;
double max;
int havemax;
-
+
int N = model->N;
int L = model->L;
double* p0 = model->p0;
double** a = model->a;
double** mu = model->mu;
double** cov = model->cov;
-
+
/* inverse covariance and its determinant */
double** icov = (double**) malloc(L*sizeof(double*));
for (i = 0; i < L; i++)
icov[i] = (double*) malloc(L*sizeof(double));
double detcov;
-
+
double** logb = (double**) malloc(T*sizeof(double*));
double** phi = (double**) malloc(T*sizeof(double*));
int** psi = (int**) malloc(T*sizeof(int*));
@@ -608,24 +608,24 @@ void viterbi_decode(double** x, int T, model_t* model, int* q)
phi[t] = (double*) malloc(N*sizeof(double));
psi[t] = (int*) malloc(N*sizeof(int));
}
-
+
/* temporary memory */
double* gauss_y = (double*) malloc(L*sizeof(double));
- double* gauss_z = (double*) malloc(L*sizeof(double));
-
+ double* gauss_z = (double*) malloc(L*sizeof(double));
+
/* calculate observation logprobs */
invert(cov, L, icov, &detcov);
for (t = 0; t < T; t++)
for (i = 0; i < N; i++)
logb[t][i] = loggauss(x[t], L, mu[i], icov, detcov, gauss_y, gauss_z);
-
+
/* initialise */
for (i = 0; i < N; i++)
{
phi[0][i] = log(p0[i]) + logb[0][i];
psi[0][i] = 0;
}
-
+
for (t = 1; t < T; t++)
{
for (j = 0; j < N; j++)
@@ -646,7 +646,7 @@ void viterbi_decode(double** x, int T, model_t* model, int* q)
}
}
}
-
+
/* find maximising state at time T-1 */
max = phi[T-1][0];
q[T-1] = 0;
@@ -659,7 +659,7 @@ void viterbi_decode(double** x, int T, model_t* model, int* q)
}
}
-
+
/* track back */
t = T - 2;
while (t >= 0)
@@ -667,7 +667,7 @@ void viterbi_decode(double** x, int T, model_t* model, int* q)
q[t] = psi[t+1][q[t+1]];
t--;
}
-
+
/* de-allocate memory */
for (i = 0; i < L; i++)
free(icov[i]);
@@ -681,7 +681,7 @@ void viterbi_decode(double** x, int T, model_t* model, int* q)
free(logb);
free(phi);
free(psi);
-
+
free(gauss_y);
free(gauss_z);
}
@@ -695,11 +695,11 @@ void invert(double** cov, int L, double** icov, double* detcov)
for(j=0; j < L; j++)
for (i=0; i < L; i++)
a[j*L+i] = cov[i][j];
-
- int M = (int) L;
+
+ int M = (int) L;
int* ipiv = (int *) malloc(L*L*sizeof(int));
int ret;
-
+
/* LU decomposition */
ret = dgetrf_(&M, &M, a, &M, ipiv, &ret); /* ret should be zero, negative if cov is singular */
if (ret < 0)
@@ -707,7 +707,7 @@ void invert(double** cov, int L, double** icov, double* detcov)
fprintf(stderr, "Covariance matrix was singular, couldn't invert\n");
exit(-1);
}
-
+
/* find determinant */
double det = 1;
for(i = 0; i < L; i++)
@@ -723,27 +723,27 @@ void invert(double** cov, int L, double** icov, double* detcov)
if (det < 0)
det = -det;
*detcov = det;
-
+
/* allocate required working storage */
#ifndef HAVE_ATLAS
int lwork = -1;
double lwbest = 0.0;
dgetri_(&M, a, &M, ipiv, &lwbest, &lwork, &ret);
- lwork = (int) lwbest;
+ lwork = (int) lwbest;
double* work = (double*) malloc(lwork*sizeof(double));
#endif
-
+
/* find inverse */
dgetri_(&M, a, &M, ipiv, work, &lwork, &ret);
for(j=0; j < L; j++)
for (i=0; i < L; i++)
- icov[i][j] = a[j*L+i];
-
-#ifndef HAVE_ATLAS
+ icov[i][j] = a[j*L+i];
+
+#ifndef HAVE_ATLAS
free(work);
#endif
- free(a);
+ free(a);
}
/* probability of multivariate Gaussian given mean, inverse and determinant of covariance */
@@ -762,8 +762,8 @@ double gauss(double* x, int L, double* mu, double** icov, double detcov, double*
}
s = cblas_ddot(L, z, 1, y, 1);
//for (i = 0; i < L; i++)
- // s += z[i] * y[i];
-
+ // s += z[i] * y[i];
+
return exp(-s/2.0) / (pow(2*PI, L/2.0) * sqrt(detcov));
}
@@ -784,10 +784,10 @@ double loggauss(double* x, int L, double* mu, double** icov, double detcov, doub
}
s = cblas_ddot(L, z, 1, y, 1);
//for (i = 0; i < L; i++)
- // s += z[i] * y[i];
-
+ // s += z[i] * y[i];
+
ret = -0.5 * (s + L * log(2*PI) + log(detcov));
-
+
/*
// TEST
if (ISINF(ret) > 0)
@@ -795,9 +795,9 @@ double loggauss(double* x, int L, double* mu, double** icov, double detcov, doub
if (ISINF(ret) < 0)
printf("loggauss returning -infinity\n");
if (ISNAN(ret))
- printf("loggauss returning nan\n");
+ printf("loggauss returning nan\n");
*/
-
+
return ret;
}
diff --git a/libs/qm-dsp/maths/MathUtilities.cpp b/libs/qm-dsp/maths/MathUtilities.cpp
index 2249c53a95..a55252b365 100644
--- a/libs/qm-dsp/maths/MathUtilities.cpp
+++ b/libs/qm-dsp/maths/MathUtilities.cpp
@@ -41,11 +41,11 @@ void MathUtilities::getAlphaNorm(const double *data, unsigned int len, unsigned
unsigned int i;
double temp = 0.0;
double a=0.0;
-
+
for( i = 0; i < len; i++)
{
temp = data[ i ];
-
+
a += ::pow( fabs(temp), double(alpha) );
}
a /= ( double )len;
@@ -60,11 +60,11 @@ double MathUtilities::getAlphaNorm( const std::vector <double> &data, unsigned i
unsigned int len = data.size();
double temp = 0.0;
double a=0.0;
-
+
for( i = 0; i < len; i++)
{
temp = data[ i ];
-
+
a += ::pow( fabs(temp), double(alpha) );
}
a /= ( double )len;
@@ -143,7 +143,7 @@ double MathUtilities::mean(const double *src, unsigned int len)
double retVal =0.0;
double s = sum( src, len );
-
+
retVal = s / (double)len;
return retVal;
@@ -154,7 +154,7 @@ double MathUtilities::mean(const std::vector<double> &src,
unsigned int count)
{
double sum = 0.;
-
+
for (unsigned int i = 0; i < count; ++i)
{
sum += src[start + i];
@@ -172,7 +172,7 @@ void MathUtilities::getFrameMinMax(const double *data, unsigned int len, double
*min = *max = 0;
return;
}
-
+
*min = data[0];
*max = data[0];
@@ -188,7 +188,7 @@ void MathUtilities::getFrameMinMax(const double *data, unsigned int len, double
{
*max = temp ;
}
-
+
}
}
@@ -197,7 +197,7 @@ int MathUtilities::getMax( double* pData, unsigned int Length, double* pMax )
unsigned int index = 0;
unsigned int i;
double temp = 0.0;
-
+
double max = pData[0];
for( i = 0; i < Length; i++)
@@ -209,7 +209,7 @@ int MathUtilities::getMax( double* pData, unsigned int Length, double* pMax )
max = temp ;
index = i;
}
-
+
}
if (pMax) *pMax = max;
@@ -223,7 +223,7 @@ int MathUtilities::getMax( const std::vector<double> & data, double* pMax )
unsigned int index = 0;
unsigned int i;
double temp = 0.0;
-
+
double max = data[0];
for( i = 0; i < data.size(); i++)
@@ -235,7 +235,7 @@ int MathUtilities::getMax( const std::vector<double> & data, double* pMax )
max = temp ;
index = i;
}
-
+
}
if (pMax) *pMax = max;
@@ -344,7 +344,7 @@ void MathUtilities::adaptiveThreshold(std::vector<double> &data)
if (sz == 0) return;
std::vector<double> smoothed(sz);
-
+
int p_pre = 8;
int p_post = 7;
diff --git a/libs/qm-dsp/maths/MathUtilities.h b/libs/qm-dsp/maths/MathUtilities.h
index 1d3395e8ad..85774756d4 100644
--- a/libs/qm-dsp/maths/MathUtilities.h
+++ b/libs/qm-dsp/maths/MathUtilities.h
@@ -22,7 +22,7 @@
class MathUtilities
{
-public:
+public:
static double round( double x );
static void getFrameMinMax( const double* data, unsigned int len, double* min, double* max );
diff --git a/libs/qm-dsp/maths/pca/pca.c b/libs/qm-dsp/maths/pca/pca.c
index 288ec4d2e4..d2b2f11c47 100644
--- a/libs/qm-dsp/maths/pca/pca.c
+++ b/libs/qm-dsp/maths/pca/pca.c
@@ -110,7 +110,7 @@ void tred2(double** a, int n, double* d, double* e)
{
int l, k, j, i;
double scale, hh, h, g, f;
-
+
for (i = n-1; i >= 1; i--)
{
l = i - 1;
@@ -188,7 +188,7 @@ void tqli(double* d, double* e, int n, double** z)
{
int m, l, iter, i, k;
double s, r, p, g, f, dd, c, b;
-
+
for (i = 1; i < n; i++)
e[i-1] = e[i];
e[n-1] = 0.0;
@@ -253,19 +253,19 @@ void pca_project(double** data, int n, int m, int ncomponents)
{
int i, j, k, k2;
double **symmat, **symmat2, *evals, *interm;
-
+
//TODO: assert ncomponents < m
-
+
symmat = (double**) malloc(m*sizeof(double*));
for (i = 0; i < m; i++)
symmat[i] = (double*) malloc(m*sizeof(double));
-
+
covcol(data, n, m, symmat);
-
+
/*********************************************************************
Eigen-reduction
**********************************************************************/
-
+
/* Allocate storage for dummy and new vectors. */
evals = (double*) malloc(m*sizeof(double)); /* Storage alloc. for vector of eigenvalues */
interm = (double*) malloc(m*sizeof(double)); /* Storage alloc. for 'intermediate' vector */
@@ -278,7 +278,7 @@ void pca_project(double** data, int n, int m, int ncomponents)
tred2(symmat, m, evals, interm); /* Triangular decomposition */
tqli(evals, interm, m, symmat); /* Reduction of sym. trid. matrix */
/* evals now contains the eigenvalues,
-columns of symmat now contain the associated eigenvectors. */
+columns of symmat now contain the associated eigenvectors. */
/*
printf("\nEigenvalues:\n");
@@ -289,7 +289,7 @@ columns of symmat now contain the associated eigenvectors. */
printf("Eigenvalues are often expressed as cumulative\n");
printf("percentages, representing the 'percentage variance\n");
printf("explained' by the associated axis or principal component.)\n");
-
+
printf("\nEigenvectors:\n");
printf("(First three; their definition in terms of original vbes.)\n");
for (j = 0; j < m; j++) {
@@ -310,7 +310,7 @@ for (i = 0; i < n; i++) {
}
}
-/*
+/*
printf("\nProjections of row-points on first 3 prin. comps.:\n");
for (i = 0; i < n; i++) {
for (j = 0; j < 3; j++) {
diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc
index de50235ee9..0d13c8f264 100644
--- a/libs/surfaces/control_protocol/basic_ui.cc
+++ b/libs/surfaces/control_protocol/basic_ui.cc
@@ -44,7 +44,7 @@ BasicUI::BasicUI ()
BasicUI::~BasicUI ()
{
-
+
}
void
@@ -148,7 +148,7 @@ BasicUI::transport_play (bool from_last_start)
if (session->get_play_range ()) {
session->request_play_range (0);
}
-
+
if (from_last_start && rolling) {
session->request_locate (session->last_transport_start(), true);
@@ -186,7 +186,7 @@ void
BasicUI::prev_marker ()
{
framepos_t pos = session->locations()->first_mark_before (session->transport_frame());
-
+
if (pos >= 0) {
session->request_locate (pos, session->transport_rolling());
} else {
@@ -330,26 +330,26 @@ BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bo
if (momentary) {
_solo_release = new SoloMuteRelease (_route->soloed());
}
-
+
if (global) {
-
+
if (_solo_release) {
_solo_release->routes = _session->get_routes ();
}
-
+
if (Config->get_solo_control_is_listen_control()) {
_session->set_listen (_session->get_routes(), !_route->listening(), Session::rt_cleanup, true);
} else {
_session->set_solo (_session->get_routes(), !_route->soloed(), Session::rt_cleanup, true);
}
-
+
} else if (exclusive) {
-
+
if (_solo_release) {
_solo_release->exclusive = true;
-
+
boost::shared_ptr<RouteList> routes = _session->get_routes();
-
+
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
if ((*i)->soloed ()) {
_solo_release->routes_on->push_back (*i);
@@ -358,51 +358,51 @@ BasicUI::solo_press (boost::shared_ptr<Route> r, bool momentary, bool global, bo
}
}
}
-
+
if (Config->get_solo_control_is_listen_control()) {
/* ??? we need a just_one_listen() method */
} else {
_session->set_just_one_solo (_route, true);
}
-
+
} else if (isolate) {
-
+
// shift-click: toggle solo isolated status
-
+
_route->set_solo_isolated (!_route->solo_isolated(), this);
delete _solo_release;
_solo_release = 0;
-
+
} else if (solo_group) {
-
+
/* Primary-button1: solo mix group.
NOTE: Primary-button2 is MIDI learn.
*/
-
+
if (_route->route_group()) {
-
+
if (_solo_release) {
_solo_release->routes = _route->route_group()->route_list();
}
-
+
if (Config->get_solo_control_is_listen_control()) {
_session->set_listen (_route->route_group()->route_list(), !_route->listening(), Session::rt_cleanup, true);
} else {
_session->set_solo (_route->route_group()->route_list(), !_route->soloed(), Session::rt_cleanup, true);
}
}
-
+
} else {
-
+
/* click: solo this route */
-
+
boost::shared_ptr<RouteList> rl (new RouteList);
rl->push_back (route());
-
+
if (_solo_release) {
_solo_release->routes = rl;
}
-
+
if (Config->get_solo_control_is_listen_control()) {
_session->set_listen (rl, !_route->listening());
} else {
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc
index b91308c7be..7a218e8532 100644
--- a/libs/surfaces/control_protocol/control_protocol.cc
+++ b/libs/surfaces/control_protocol/control_protocol.cc
@@ -166,7 +166,7 @@ ControlProtocol::set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR
if (table_index >= route_table.size()) {
return;
}
-
+
route_table[table_index] = r;
// XXX SHAREDPTR need to handle r->GoingAway
@@ -245,7 +245,7 @@ ControlProtocol::route_set_gain (uint32_t table_index, float gain)
}
boost::shared_ptr<Route> r = route_table[table_index];
-
+
if (r != 0) {
r->set_gain (gain, this);
}
diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h
index d62a5da5ad..4c8a8ba28f 100644
--- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h
+++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h
@@ -41,7 +41,7 @@ class LIBCONTROLCP_API BasicUI {
public:
BasicUI (ARDOUR::Session&);
virtual ~BasicUI ();
-
+
void add_marker (const std::string& = std::string());
void register_thread (std::string name);
diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h
index 3a0eb41509..8edb3f39a7 100644
--- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h
+++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h
@@ -88,7 +88,7 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope
respond. Typically this will always be GUI->"others" - the GUI pays
no attention to these signals.
*/
-
+
static PBD::Signal1<void,RouteNotificationListPtr> TrackSelectionChanged;
/* the model here is as follows:
@@ -163,7 +163,7 @@ extern "C" {
bool (*probe)(ControlProtocolDescriptor*);
ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
-
+
};
}
diff --git a/libs/surfaces/control_protocol/control_protocol/types.h b/libs/surfaces/control_protocol/control_protocol/types.h
index 8c05953320..1d46753e51 100644
--- a/libs/surfaces/control_protocol/control_protocol/types.h
+++ b/libs/surfaces/control_protocol/control_protocol/types.h
@@ -26,7 +26,7 @@
namespace ARDOUR {
class Route;
-
+
typedef std::vector<boost::weak_ptr<ARDOUR::Route> > RouteNotificationList;
typedef boost::shared_ptr<RouteNotificationList> RouteNotificationListPtr;
diff --git a/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c b/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c
index 96bc3f95ef..480c49c7b6 100644
--- a/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c
+++ b/libs/surfaces/frontier/kernel_drivers/tests/tranzport.c
@@ -110,7 +110,7 @@ tranzport_t *open_tranzport_core()
tranzport_t *open_tranzport()
{
-return open_tranzport_core();
+return open_tranzport_core();
}
void close_tranzport(tranzport_t *z)
@@ -191,7 +191,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t *
{
uint8_t buf[8];
int val;
-
+
memset(buf, 0xff, 8);
val = read(z->udev, buf, 8);
if (val < 0) {
diff --git a/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c b/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c
index 4096ee680d..f116c50a74 100644
--- a/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c
+++ b/libs/surfaces/frontier/kernel_drivers/tests/tranzport_lights.c
@@ -109,7 +109,7 @@ tranzport_t *open_tranzport_core()
tranzport_t *open_tranzport()
{
-return open_tranzport_core();
+return open_tranzport_core();
}
void close_tranzport(tranzport_t *z)
@@ -190,7 +190,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t *
{
uint8_t buf[8];
int val;
-
+
memset(buf, 0xff, 8);
val = read(z->udev, buf, 8);
if (val < 0) {
diff --git a/libs/surfaces/frontier/kernel_drivers/tranzport.c b/libs/surfaces/frontier/kernel_drivers/tranzport.c
index 951be979d0..e7377cc65b 100644
--- a/libs/surfaces/frontier/kernel_drivers/tranzport.c
+++ b/libs/surfaces/frontier/kernel_drivers/tranzport.c
@@ -235,7 +235,7 @@ struct usb_tranzport {
unsigned char LightPunch;
unsigned char last_cmd[8];
unsigned char screen[40]; // We'll also have cells
-
+
};
/* prevent races between open() and disconnect() */
@@ -405,12 +405,12 @@ static void usb_tranzport_interrupt_in_callback(struct urb *urb)
/* Always pass one offline event up the stack */
if(dev->offline > 0 && dev->interrupt_in_buffer[1] != 0xff) { dev->offline = 0; }
if(dev->offline == 0 && dev->interrupt_in_buffer[1] == 0xff) { dev->offline = 1; }
-
+
#endif
dbg_info(&dev->intf->dev, "%s: head, tail are %x, %x\n", __FUNCTION__,dev->ring_head,dev->ring_tail);
next_ring_head = (dev->ring_head+1) % ring_buffer_size;
-
+
if (next_ring_head != dev->ring_tail) {
memcpy(&((*dev->ring_buffer)[dev->ring_head]), dev->interrupt_in_buffer, urb->actual_length);
dev->ring_head = next_ring_head;
@@ -687,7 +687,7 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
dbg_info(&dev->intf->dev, "%s: trying to compress: %02x%02x%02x%02x%02x %02x %02x %02x\n",
__FUNCTION__, (*dev->ring_buffer)[dev->ring_tail].cmd[0],(*dev->ring_buffer)[dev->ring_tail].cmd[1],(*dev->ring_buffer)[dev->ring_tail].cmd[2],(*dev->ring_buffer)[dev->ring_tail].cmd[3],(*dev->ring_buffer)[dev->ring_tail].cmd[4],(*dev->ring_buffer)[dev->ring_tail].cmd[5],(*dev->ring_buffer)[dev->ring_tail].cmd[6],(*dev->ring_buffer)[dev->ring_tail].cmd[7]);
-
+
if(((*dev->ring_buffer)[dev->ring_tail].cmd[6] != 0 &&
(*dev->ring_buffer)[next_tail].cmd[6] != 0 ) &&
((newwheel > 0 && oldwheel > 0) ||
@@ -723,13 +723,13 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer, size_t
retval = -EFAULT;
goto unlock_exit;
}
-
+
dev->ring_tail = (dev->ring_tail+1) % ring_buffer_size;
c+=8;
dbg_info(&dev->intf->dev, "%s: head, tail are %x, %x\n", __FUNCTION__,dev->ring_head,dev->ring_tail);
}
retval = c;
-
+
#else
if (copy_to_user(buffer, &(*dev->ring_buffer)[dev->ring_tail], 8)) {
retval = -EFAULT;
diff --git a/libs/surfaces/frontier/tests/tranzport_lights.c b/libs/surfaces/frontier/tests/tranzport_lights.c
index 28a8462d84..07867d6dd0 100644
--- a/libs/surfaces/frontier/tests/tranzport_lights.c
+++ b/libs/surfaces/frontier/tests/tranzport_lights.c
@@ -109,7 +109,7 @@ tranzport_t *open_tranzport_core()
tranzport_t *open_tranzport()
{
-return open_tranzport_core();
+return open_tranzport_core();
}
void close_tranzport(tranzport_t *z)
@@ -190,7 +190,7 @@ int tranzport_read(tranzport_t *z, uint8_t *status, uint32_t *buttons, uint8_t *
{
uint8_t buf[8];
int val;
-
+
memset(buf, 0xff, 8);
val = read(z->udev, buf, 8);
if (val < 0) {
diff --git a/libs/surfaces/frontier/tranzport/interface.cc b/libs/surfaces/frontier/tranzport/interface.cc
index e60524d24c..f019c02f45 100644
--- a/libs/surfaces/frontier/tranzport/interface.cc
+++ b/libs/surfaces/frontier/tranzport/interface.cc
@@ -33,7 +33,7 @@ new_tranzport_protocol (ControlProtocolDescriptor* descriptor, Session* s)
}
return tcp;
-
+
}
void
@@ -59,7 +59,7 @@ static ControlProtocolDescriptor tranzport_descriptor = {
initialize : new_tranzport_protocol,
destroy : delete_tranzport_protocol
};
-
+
extern "C" {
ControlProtocolDescriptor*
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
index 773ac2d5a1..f093287f50 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.cc
@@ -273,7 +273,7 @@ TranzportControlProtocol::screen_flush ()
printf("usb screen update failed for some reason... why? \ncmd and data were %02x %02x %02x %02x %02x %02x %02x %02x\n",
cmd[0],cmd[1],cmd[2], cmd[3], cmd[4], cmd[5],cmd[6],cmd[7]);
#endif
- pending += 1;
+ pending += 1;
// Shouldn't need to do this
// screen_invalid[row][col_base] = screen_invalid[row][col_base+1] =
// screen_invalid[row][col_base+2] = screen_invalid[row][col_base+3] = true;
@@ -592,7 +592,7 @@ void
TranzportControlProtocol::show_transport_time ()
{
show_bbt (session->transport_frame ());
-}
+}
void
TranzportControlProtocol::show_smpte (framepos_t where)
@@ -689,7 +689,7 @@ TranzportControlProtocol::open_core (struct usb_device* dev)
error << _("Tranzport: cannot open USB transport") << endmsg;
return -1;
}
-
+
if (usb_claim_interface (udev, 0) < 0) {
error << _("Tranzport: cannot claim USB interface") << endmsg;
usb_close (udev);
@@ -737,7 +737,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override)
return val;
}
-
+
int
TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override)
{
@@ -762,7 +762,7 @@ TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override
return 0;
-}
+}
int
TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
@@ -771,7 +771,7 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
int val;
int retry = 0;
if(inflight > MAX_TRANZPORT_INFLIGHT) { return (-1); }
-
+
while((val = usb_interrupt_write (udev, WRITE_ENDPOINT, (char*) cmd, 8, timeout_override ? timeout_override : timeout))!=8 && retry++ < MAX_RETRY) {
printf("usb_interrupt_write failed, retrying: %d\n", val);
}
@@ -794,7 +794,7 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
return (write_noretry(cmd,timeout_override));
#endif
-}
+}
#else
#error Kernel API not defined yet for Tranzport
@@ -863,7 +863,7 @@ bool TranzportControlProtocol::lcd_isdamaged ()
for(int r = 0; r < 2; r++) {
for(int c = 0; c < 20; c++) {
if(screen_invalid[r][c]) {
-#if DEBUG_TRANZPORT > 5
+#if DEBUG_TRANZPORT > 5
printf("row: %d,col: %d is damaged, should redraw it\n", r,c);
#endif
return true;
@@ -881,7 +881,7 @@ bool TranzportControlProtocol::lcd_isdamaged (int row, int col, int length)
if((row >= 0 && row < 2) && (col >=0 && col < 20)) {
for(int c = col; c < endcol; c++) {
if(screen_invalid[row][c]) {
-#if DEBUG_TRANZPORT > 5
+#if DEBUG_TRANZPORT > 5
printf("row: %d,col: %d is damaged, should redraw it\n", row,c);
#endif
return true;
@@ -1007,7 +1007,7 @@ int TranzportControlProtocol::rtpriority_unset(int priority)
struct sched_param rtparam;
int err;
memset (&rtparam, 0, sizeof (rtparam));
- rtparam.sched_priority = priority;
+ rtparam.sched_priority = priority;
if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
PBD::info << string_compose (_("%1: can't stop realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
return 1;
@@ -1731,7 +1731,7 @@ TranzportControlProtocol::step_gain_up ()
if (gain_fraction > 2.0) {
gain_fraction = 2.0;
}
-
+
route_set_gain (0, slider_position_to_gain (gain_fraction));
}
@@ -1747,7 +1747,7 @@ TranzportControlProtocol::step_gain_down ()
if (gain_fraction < 0.0) {
gain_fraction = 0.0;
}
-
+
route_set_gain (0, slider_position_to_gain (gain_fraction));
}
@@ -1866,7 +1866,7 @@ TranzportControlProtocol::print_noretry (int row, int col, const char *text)
uint32_t left = strlen (text);
char tmp[5];
int base_col;
-
+
if (row < 0 || row > 1) {
return;
}
@@ -1899,24 +1899,24 @@ TranzportControlProtocol::print_noretry (int row, int col, const char *text)
int offset = col % 4;
/* copy current cell contents into tmp */
-
+
memcpy (tmp, &screen_pending[row][base_col], 4);
-
+
/* overwrite with new text */
-
+
uint32_t tocopy = min ((4U - offset), left);
-
+
memcpy (tmp+offset, text, tocopy);
-
+
/* copy it back to pending */
-
+
memcpy (&screen_pending[row][base_col], tmp, 4);
-
+
text += tocopy;
left -= tocopy;
col += tocopy;
}
-}
+}
XMLNode&
TranzportControlProtocol::get_state ()
diff --git a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
index 39addbbaca..13df6915a2 100644
--- a/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/frontier/tranzport/tranzport_control_protocol.h
@@ -76,7 +76,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
WheelShiftMaster,
WheelShiftMarker
};
-
+
enum WheelMode {
WheelTimeline,
WheelScrub,
@@ -94,7 +94,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
WheelIncrSecond,
WheelIncrMinute
};
-
+
enum DisplayMode {
DisplayNormal,
DisplayRecording,
@@ -113,7 +113,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
BlingRows,
BlingFlashAll
};
-
+
pthread_t thread;
uint32_t buttonmask;
uint32_t timeout;
@@ -246,7 +246,7 @@ class TranzportControlProtocol : public ARDOUR::ControlProtocol
void show_current_track ();
void show_track_gain ();
void show_transport_time ();
- void show_bbt (framepos_t where);
+ void show_bbt (framepos_t where);
void show_smpte (framepos_t where);
void show_wheel_mode ();
void show_gain ();
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index f05e138f05..4b59151079 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -168,11 +168,11 @@ GenericMidiControlProtocol::reload_maps ()
mi.name = prop->value ();
mi.path = fullpath;
-
+
map_info.push_back (mi);
}
}
-
+
void
GenericMidiControlProtocol::drop_all ()
{
@@ -258,7 +258,7 @@ GenericMidiControlProtocol::send_feedback ()
}
_send_feedback ();
-
+
last_feedback_time = now;
}
@@ -282,7 +282,7 @@ GenericMidiControlProtocol::_send_feedback ()
if (!lm.locked ()) {
return;
}
-
+
for (MIDIControllables::iterator r = controllables.begin(); r != controllables.end(); ++r) {
MIDI::byte* end = (*r)->write_feedback (buf, bsize);
if (end != buf) {
@@ -314,7 +314,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
{
Glib::Threads::Mutex::Lock lm (pending_lock);
-
+
MIDIPendingControllables::iterator ptmp;
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) {
ptmp = i;
@@ -341,7 +341,7 @@ GenericMidiControlProtocol::start_learning (Controllable* c)
if (!mc) {
mc = new MIDIControllable (this, *_input_port->parser(), *c, false);
}
-
+
{
Glib::Threads::Mutex::Lock lm (pending_lock);
@@ -360,7 +360,7 @@ GenericMidiControlProtocol::learning_stopped (MIDIControllable* mc)
{
Glib::Threads::Mutex::Lock lm (pending_lock);
Glib::Threads::Mutex::Lock lm2 (controllables_lock);
-
+
MIDIPendingControllables::iterator tmp;
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) {
@@ -401,7 +401,7 @@ GenericMidiControlProtocol::stop_learning (Controllable* c)
break;
}
}
-
+
delete dptr;
}
@@ -410,17 +410,17 @@ GenericMidiControlProtocol::delete_binding (PBD::Controllable* control)
{
if (control != 0) {
Glib::Threads::Mutex::Lock lm2 (controllables_lock);
-
+
for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) {
MIDIControllable* existingBinding = (*iter);
-
+
if (control == (existingBinding->get_controllable())) {
delete existingBinding;
iter = controllables.erase (iter);
} else {
++iter;
}
-
+
}
}
}
@@ -431,10 +431,10 @@ GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos,
{
if (control != NULL) {
Glib::Threads::Mutex::Lock lm2 (controllables_lock);
-
+
MIDI::channel_t channel = (pos & 0xf);
MIDI::byte value = control_number;
-
+
// Create a MIDIControllable
MIDIControllable* mc = new MIDIControllable (this, *_input_port->parser(), *control, false);
@@ -442,19 +442,19 @@ GenericMidiControlProtocol::create_binding (PBD::Controllable* control, int pos,
// Note: can't use delete_binding() here because we don't know the specific controllable we want to remove, only the midi information
for (MIDIControllables::iterator iter = controllables.begin(); iter != controllables.end();) {
MIDIControllable* existingBinding = (*iter);
-
+
if ((existingBinding->get_control_channel() & 0xf ) == channel &&
existingBinding->get_control_additional() == value &&
(existingBinding->get_control_type() & 0xf0 ) == MIDI::controller) {
-
+
delete existingBinding;
iter = controllables.erase (iter);
} else {
++iter;
}
-
+
}
-
+
// Update the MIDI Controllable based on the the pos param
// Here is where a table lookup for user mappings could go; for now we'll just wing it...
mc->bind_midi(channel, MIDI::controller, value);
@@ -593,7 +593,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
}
boost::shared_ptr<Controllable> c;
-
+
{
Glib::Threads::Mutex::Lock lm (pending_lock);
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) {
@@ -625,20 +625,20 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
if (!nlist.empty()) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
if ((prop = (*niter)->property ("id")) != 0) {
-
+
ID id = prop->value ();
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Relearned binding for session: Control ID: %1\n", id.to_s()));
Controllable* c = Controllable::by_id (id);
-
+
if (c) {
MIDIControllable* mc = new MIDIControllable (this, *_input_port->parser(), *c, false);
-
+
if (mc->set_state (**niter, version) == 0) {
controllables.push_back (mc);
}
-
+
} else {
warning << string_compose (
_("Generic MIDI control: controllable %1 not found in session (ignored)"),
@@ -697,7 +697,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath)
sscanf (prop->value().c_str(), "%d.%d.%d", &major, &minor, &micro);
Stateful::loading_state_version = (major * 1000) + minor;
}
-
+
const XMLNodeList& children (root->children());
XMLNodeConstIterator citer;
XMLNodeConstIterator gciter;
@@ -708,7 +708,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath)
DEBUG_TRACE (DEBUG::GenericMidi, "Loading bindings\n");
for (citer = children.begin(); citer != children.end(); ++citer) {
-
+
if ((*citer)->name() == "DeviceInfo") {
const XMLProperty* prop;
@@ -736,7 +736,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath)
if (child->property ("uri")) {
/* controllable */
-
+
if ((mc = create_binding (*child)) != 0) {
Glib::Threads::Mutex::Lock lm2 (controllables_lock);
controllables.push_back (mc);
@@ -760,7 +760,7 @@ GenericMidiControlProtocol::load_bindings (const string& xmlpath)
}
}
}
-
+
if ((prop = root->property ("name")) != 0) {
_current_binding = prop->value ();
}
@@ -805,17 +805,17 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node)
} else {
return 0;
}
-
+
if (sscanf (prop->value().c_str(), "%d", &intval) != 1) {
return 0;
}
-
+
detail = (MIDI::byte) intval;
if ((prop = node.property (X_("channel"))) == 0) {
return 0;
}
-
+
if (sscanf (prop->value().c_str(), "%d", &intval) != 1) {
return 0;
}
@@ -830,7 +830,7 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node)
} else {
momentary = false;
}
-
+
prop = node.property (X_("uri"));
uri = prop->value();
@@ -918,7 +918,7 @@ GenericMidiControlProtocol::create_function (const XMLNode& node)
cnt = 0;
stringstream ss (prop->value());
ss << hex;
-
+
while (ss >> val) {
cnt++;
}
@@ -930,12 +930,12 @@ GenericMidiControlProtocol::create_function (const XMLNode& node)
data = new MIDI::byte[cnt];
data_size = cnt;
-
+
{
stringstream ss (prop->value());
ss << hex;
cnt = 0;
-
+
while (ss >> val) {
data[cnt++] = (MIDI::byte) val;
}
@@ -950,13 +950,13 @@ GenericMidiControlProtocol::create_function (const XMLNode& node)
if (sscanf (prop->value().c_str(), "%d", &intval) != 1) {
return 0;
}
-
+
detail = (MIDI::byte) intval;
if ((prop = node.property (X_("channel"))) == 0) {
return 0;
}
-
+
if (sscanf (prop->value().c_str(), "%d", &intval) != 1) {
return 0;
}
@@ -972,9 +972,9 @@ GenericMidiControlProtocol::create_function (const XMLNode& node)
}
prop = node.property (X_("function"));
-
+
MIDIFunction* mf = new MIDIFunction (*_input_port->parser());
-
+
if (mf->setup (*this, prop->value(), argument, data, data_size)) {
delete mf;
return 0;
@@ -1018,7 +1018,7 @@ GenericMidiControlProtocol::create_action (const XMLNode& node)
cnt = 0;
stringstream ss (prop->value());
ss << hex;
-
+
while (ss >> val) {
cnt++;
}
@@ -1030,12 +1030,12 @@ GenericMidiControlProtocol::create_action (const XMLNode& node)
data = new MIDI::byte[cnt];
data_size = cnt;
-
+
{
stringstream ss (prop->value());
ss << hex;
cnt = 0;
-
+
while (ss >> val) {
data[cnt++] = (MIDI::byte) val;
}
@@ -1050,13 +1050,13 @@ GenericMidiControlProtocol::create_action (const XMLNode& node)
if (sscanf (prop->value().c_str(), "%d", &intval) != 1) {
return 0;
}
-
+
detail = (MIDI::byte) intval;
if ((prop = node.property (X_("channel"))) == 0) {
return 0;
}
-
+
if (sscanf (prop->value().c_str(), "%d", &intval) != 1) {
return 0;
}
@@ -1068,7 +1068,7 @@ GenericMidiControlProtocol::create_action (const XMLNode& node)
}
prop = node.property (X_("action"));
-
+
MIDIAction* ma = new MIDIAction (*_input_port->parser());
if (ma->init (*this, prop->value(), data, data_size)) {
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h
index c9d11c3e09..f09c8e4883 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.h
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h
@@ -30,7 +30,7 @@
namespace PBD {
class Controllable;
class ControllableDescriptor;
-}
+}
namespace ARDOUR {
class Session;
@@ -73,7 +73,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
void drop_bindings ();
void check_used_event (int, int);
-
+
std::string current_binding() const { return _current_binding; }
struct MapInfo {
@@ -89,7 +89,7 @@ class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
void prev_bank ();
void set_motorised (bool);
-
+
bool motorised () const {
return _motorised;
}
diff --git a/libs/surfaces/generic_midi/gmcp_gui.cc b/libs/surfaces/generic_midi/gmcp_gui.cc
index 773cf36772..710b61be8e 100644
--- a/libs/surfaces/generic_midi/gmcp_gui.cc
+++ b/libs/surfaces/generic_midi/gmcp_gui.cc
@@ -40,7 +40,7 @@ class GMCPGUI : public Gtk::VBox
public:
GMCPGUI (GenericMidiControlProtocol&);
~GMCPGUI ();
-
+
private:
GenericMidiControlProtocol& cp;
Gtk::ComboBoxText map_combo;
@@ -110,7 +110,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
}
set_popdown_strings (map_combo, popdowns);
-
+
if (cp.current_binding().empty()) {
map_combo.set_active_text (popdowns[0]);
} else {
@@ -126,7 +126,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
table->set_row_spacings (6);
table->set_col_spacings (6);
table->show ();
-
+
int n = 0;
Label* label = manage (new Label (_("MIDI Bindings:")));
@@ -134,10 +134,10 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
table->attach (*label, 0, 1, n, n + 1);
table->attach (map_combo, 1, 2, n, n + 1);
++n;
-
+
map_combo.show ();
label->show ();
-
+
bank_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &GMCPGUI::bank_changed));
label = manage (new Label (_("Current Bank:")));
@@ -145,7 +145,7 @@ GMCPGUI::GMCPGUI (GenericMidiControlProtocol& p)
table->attach (*label, 0, 1, n, n + 1);
table->attach (bank_spinner, 1, 2, n, n + 1);
++n;
-
+
bank_spinner.show ();
label->show ();
diff --git a/libs/surfaces/generic_midi/interface.cc b/libs/surfaces/generic_midi/interface.cc
index b9b0e36a4d..b7e7b63dd7 100644
--- a/libs/surfaces/generic_midi/interface.cc
+++ b/libs/surfaces/generic_midi/interface.cc
@@ -28,13 +28,13 @@ static ControlProtocol*
new_generic_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
{
GenericMidiControlProtocol* gmcp;
-
+
try {
gmcp = new GenericMidiControlProtocol (*s);
} catch (failed_constructor& err) {
return 0;
}
-
+
if (gmcp->set_active (true)) {
delete gmcp;
return 0;
@@ -67,6 +67,6 @@ static ControlProtocolDescriptor generic_midi_descriptor = {
/*initialize : */ new_generic_midi_protocol,
/*destroy : */ delete_generic_midi_protocol
};
-
+
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &generic_midi_descriptor; }
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc
index 4a9b89de80..9dca702e68 100644
--- a/libs/surfaces/generic_midi/midicontrollable.cc
+++ b/libs/surfaces/generic_midi/midicontrollable.cc
@@ -71,7 +71,7 @@ MIDIControllable::MIDIControllable (GenericMidiControlProtocol* s, MIDI::Parser&
, _momentary (m)
{
set_controllable (&c);
-
+
_learned = true; /* from controllable */
_encoder = No_enc;
setting = false;
@@ -123,7 +123,7 @@ MIDIControllable::set_controllable (Controllable* c)
if (c == controllable) {
return;
}
-
+
controllable_death_connection.disconnect ();
controllable = c;
@@ -478,7 +478,7 @@ MIDIControllable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional)
}
_control_description = "MIDI control: NoteOn";
break;
-
+
case MIDI::controller:
_parser.channel_controller[chn_i].connect_same_thread (midi_sense_connection[0], boost::bind (&MIDIControllable::midi_sense_controller, this, _1, _2));
snprintf (buf, sizeof (buf), "MIDI control: Controller %d", control_additional);
@@ -507,7 +507,7 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool /*forc
if (!controllable || control_type == none || !feedback || bufsize <= 2) {
return buf;
}
-
+
int const gm = control_to_midi (controllable->get_value());
if (gm == last_value) {
@@ -611,7 +611,7 @@ int
MIDIControllable::max_value_for_type () const
{
/* XXX: this is not complete */
-
+
if (control_type == MIDI::pitchbend) {
return 16383;
}
diff --git a/libs/surfaces/generic_midi/midicontrollable.h b/libs/surfaces/generic_midi/midicontrollable.h
index 5a4a762089..2e5d41c5d6 100644
--- a/libs/surfaces/generic_midi/midicontrollable.h
+++ b/libs/surfaces/generic_midi/midicontrollable.h
@@ -68,7 +68,7 @@ class MIDIControllable : public PBD::Stateful
};
MIDI::byte* write_feedback (MIDI::byte* buf, int32_t& bufsize, bool force = false);
-
+
void midi_rebind (MIDI::channel_t channel=-1);
void midi_forget ();
void learn_about_external_control ();
@@ -104,7 +104,7 @@ class MIDIControllable : public PBD::Stateful
MIDI::byte get_control_additional () { return control_additional; }
int lookup_controllable();
-
+
private:
int max_value_for_type () const;
diff --git a/libs/surfaces/generic_midi/midiinvokable.cc b/libs/surfaces/generic_midi/midiinvokable.cc
index 48d8497ce3..9d679b1e8e 100644
--- a/libs/surfaces/generic_midi/midiinvokable.cc
+++ b/libs/surfaces/generic_midi/midiinvokable.cc
@@ -141,7 +141,7 @@ MIDIInvokable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional)
case MIDI::on:
_parser.channel_note_on[chn_i].connect_same_thread (midi_sense_connection[0], boost::bind (&MIDIInvokable::midi_sense_note_on, this, _1, _2));
break;
-
+
case MIDI::controller:
_parser.channel_controller[chn_i].connect_same_thread (midi_sense_connection[0], boost::bind (&MIDIInvokable::midi_sense_controller, this, _1, _2));
break;
diff --git a/libs/surfaces/generic_midi/midiinvokable.h b/libs/surfaces/generic_midi/midiinvokable.h
index bde59b64de..dee87ed09c 100644
--- a/libs/surfaces/generic_midi/midiinvokable.h
+++ b/libs/surfaces/generic_midi/midiinvokable.h
@@ -50,7 +50,7 @@ class MIDIInvokable : public PBD::Stateful
MIDI::channel_t get_control_channel () { return control_channel; }
MIDI::eventType get_control_type () { return control_type; }
MIDI::byte get_control_additional () { return control_additional; }
-
+
protected:
GenericMidiControlProtocol* _ui;
std::string _invokable_name;
diff --git a/libs/surfaces/mackie/button.cc b/libs/surfaces/mackie/button.cc
index c9ae1f5d71..53a43de5ba 100644
--- a/libs/surfaces/mackie/button.cc
+++ b/libs/surfaces/mackie/button.cc
@@ -104,9 +104,9 @@ Button::name_to_id (const std::string& name)
if (!g_ascii_strcasecmp (name.c_str(), "Scrub")) { return Scrub; }
if (!g_ascii_strcasecmp (name.c_str(), "User A")) { return UserA; }
if (!g_ascii_strcasecmp (name.c_str(), "User B")) { return UserB; }
-
+
/* Strip buttons */
-
+
if (!g_ascii_strcasecmp (name.c_str(), "Record Enable")) { return RecEnable; }
if (!g_ascii_strcasecmp (name.c_str(), "Solo")) { return Solo; }
if (!g_ascii_strcasecmp (name.c_str(), "Mute")) { return Mute; }
diff --git a/libs/surfaces/mackie/button.h b/libs/surfaces/mackie/button.h
index 61f09d7a03..42d2ec45b1 100644
--- a/libs/surfaces/mackie/button.h
+++ b/libs/surfaces/mackie/button.h
@@ -39,7 +39,7 @@ public:
enum ID {
/* Global Buttons */
-
+
Track,
Send,
Pan,
@@ -111,7 +111,7 @@ public:
CmdAlt,
/* Strip buttons */
-
+
RecEnable,
Solo,
Mute,
@@ -129,12 +129,12 @@ public:
: Control (did, name, group)
, _bid (bid)
, _led (did, name + "_led", group) {}
-
+
MidiByteArray zero() { return _led.zero (); }
MidiByteArray set_state (LedState ls) { return _led.set_state (ls); }
-
+
ID bid() const { return _bid; }
-
+
static Control* factory (Surface& surface, Button::ID bid, int id, const std::string&, Group& group);
static int name_to_id (const std::string& name);
static std::string id_to_name (Button::ID);
diff --git a/libs/surfaces/mackie/control_group.h b/libs/surfaces/mackie/control_group.h
index 4955098225..e79a60f42f 100644
--- a/libs/surfaces/mackie/control_group.h
+++ b/libs/surfaces/mackie/control_group.h
@@ -19,21 +19,21 @@ public:
: _name (name) {}
virtual ~Group() {}
-
+
virtual bool is_strip() const { return false; }
virtual bool is_master() const { return false; }
-
+
virtual void add (Control & control);
-
+
const std::string & name() const { return _name; }
void set_name (const std::string & rhs) { _name = rhs; }
-
+
typedef std::vector<Control*> Controls;
const Controls & controls() const { return _controls; }
-
+
protected:
Controls _controls;
-
+
private:
std::string _name;
};
diff --git a/libs/surfaces/mackie/controls.cc b/libs/surfaces/mackie/controls.cc
index 1c88c2b74c..bbe1029f30 100644
--- a/libs/surfaces/mackie/controls.cc
+++ b/libs/surfaces/mackie/controls.cc
@@ -101,7 +101,7 @@ Control::start_touch (double when)
return normal_ac->start_touch (when);
}
}
-
+
void
Control::stop_touch (bool mark, double when)
{
@@ -109,7 +109,7 @@ Control::stop_touch (bool mark, double when)
return normal_ac->stop_touch (mark, when);
}
}
-
+
ostream & operator << (ostream & os, const ArdourSurface::Mackie::Control & control)
{
os << typeid (control).name();
@@ -120,7 +120,7 @@ ostream & operator << (ostream & os, const ArdourSurface::Mackie::Control & con
os << ", ";
os << "group: " << control.group().name();
os << " }";
-
+
return os;
}
diff --git a/libs/surfaces/mackie/controls.h b/libs/surfaces/mackie/controls.h
index e8098ccf7e..38eb30fb65 100644
--- a/libs/surfaces/mackie/controls.h
+++ b/libs/surfaces/mackie/controls.h
@@ -48,14 +48,14 @@ class Control {
public:
Control (int id, std::string name, Group& group);
virtual ~Control() {}
-
+
int id() const { return _id; }
const std::string & name() const { return _name; }
Group & group() const { return _group; }
bool in_use () const;
void set_in_use (bool);
-
+
// Keep track of the timeout so it can be updated with more incoming events
sigc::connection in_use_connection;
@@ -71,7 +71,7 @@ public:
float get_value ();
void set_value (float val);
-
+
virtual void start_touch (double when);
virtual void stop_touch (bool mark, double when);
diff --git a/libs/surfaces/mackie/device_info.cc b/libs/surfaces/mackie/device_info.cc
index 365ff1db9f..b0ce131e00 100644
--- a/libs/surfaces/mackie/device_info.cc
+++ b/libs/surfaces/mackie/device_info.cc
@@ -377,7 +377,7 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
}
}
}
-
+
}
} else if ((*i)->name() == "StripButton") {
@@ -393,9 +393,9 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
}
}
}
-
+
}
-
+
}
}
}
diff --git a/libs/surfaces/mackie/device_info.h b/libs/surfaces/mackie/device_info.h
index c4cbd071c5..2f4f769127 100644
--- a/libs/surfaces/mackie/device_info.h
+++ b/libs/surfaces/mackie/device_info.h
@@ -62,7 +62,7 @@ class DeviceInfo
LCXT = 0x11,
HUI = 0x5
};
-
+
DeviceInfo();
~DeviceInfo();
@@ -85,7 +85,7 @@ class DeviceInfo
static std::map<std::string,DeviceInfo> device_info;
static void reload_device_info();
-
+
std::string& get_global_button_name(Button::ID);
GlobalButtonInfo& get_global_button(Button::ID);
@@ -94,7 +94,7 @@ class DeviceInfo
const GlobalButtonsInfo& global_buttons() const { return _global_buttons; }
const StripButtonsInfo& strip_buttons() const { return _strip_buttons; }
-
+
private:
uint32_t _strip_cnt;
uint32_t _extenders;
diff --git a/libs/surfaces/mackie/device_profile.cc b/libs/surfaces/mackie/device_profile.cc
index c4cd9bf1a8..2b9cbd5edb 100644
--- a/libs/surfaces/mackie/device_profile.cc
+++ b/libs/surfaces/mackie/device_profile.cc
@@ -339,7 +339,7 @@ DeviceProfile::save ()
}
fullpath = Glib::build_filename (fullpath, legalize_for_path (_name) + ".profile");
-
+
XMLTree tree;
tree.set_root (&get_state());
diff --git a/libs/surfaces/mackie/device_profile.h b/libs/surfaces/mackie/device_profile.h
index 15702a6886..ab1e645e56 100644
--- a/libs/surfaces/mackie/device_profile.h
+++ b/libs/surfaces/mackie/device_profile.h
@@ -37,16 +37,16 @@ class DeviceProfile
public:
DeviceProfile (const std::string& name = "");
~DeviceProfile();
-
+
std::string get_button_action (Button::ID, int modifier_state) const;
void set_button_action (Button::ID, int modifier_state, const std::string&);
-
+
const std::string& name() const;
void set_path (const std::string&);
static void reload_device_profiles ();
static std::map<std::string,DeviceProfile> device_profiles;
-
+
private:
struct ButtonActions {
std::string plain;
@@ -56,13 +56,13 @@ class DeviceProfile
std::string cmdalt;
std::string shiftcontrol;
};
-
+
typedef std::map<Button::ID,ButtonActions> ButtonActionMap;
-
+
std::string _name;
std::string _path;
ButtonActionMap _button_map;
-
+
int set_state (const XMLNode&, int version);
XMLNode& get_state () const;
diff --git a/libs/surfaces/mackie/fader.cc b/libs/surfaces/mackie/fader.cc
index 5e40538096..33e1e4c29f 100644
--- a/libs/surfaces/mackie/fader.cc
+++ b/libs/surfaces/mackie/fader.cc
@@ -66,7 +66,7 @@ Fader::update_message ()
}
last_update_position = posi;
-
+
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("generate fader message for position %1 (%2)\n", position, posi));
return MidiByteArray (3, 0xe0 + id(), posi & 0x7f, posi >> 7);
}
diff --git a/libs/surfaces/mackie/fader.h b/libs/surfaces/mackie/fader.h
index e83e657e68..dae022c690 100644
--- a/libs/surfaces/mackie/fader.h
+++ b/libs/surfaces/mackie/fader.h
@@ -10,7 +10,7 @@ namespace Mackie {
class Fader : public Control
{
public:
-
+
Fader (int id, std::string name, Group & group)
: Control (id, name, group)
, position (0.0)
@@ -20,11 +20,11 @@ class Fader : public Control
MidiByteArray set_position (float);
MidiByteArray zero() { return set_position (0.0); }
-
+
MidiByteArray update_message ();
static Control* factory (Surface&, int id, const char*, Group&);
-
+
private:
float position;
int last_update_position;
diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc
index 48bfa6cd8a..156070dbc8 100644
--- a/libs/surfaces/mackie/gui.cc
+++ b/libs/surfaces/mackie/gui.cc
@@ -89,7 +89,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
Gtk::Label* l;
Gtk::Alignment* align;
int row = 0;
-
+
set_border_width (12);
Gtk::Table* table = Gtk::manage (new Gtk::Table (2, 12));
@@ -102,9 +102,9 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
table->attach (_surface_combo, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
row++;
-
+
vector<string> surfaces;
-
+
for (std::map<std::string,DeviceInfo>::iterator i = DeviceInfo::device_info.begin(); i != DeviceInfo::device_info.end(); ++i) {
surfaces.push_back (i->first);
}
@@ -127,7 +127,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
send_string = _("Surface sends via:");
receive_string = _("Surface receives via:");
}
-
+
l = manage (new Gtk::Label (send_string));
l->set_alignment (1.0, 0.5);
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
@@ -149,10 +149,10 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
table->attach (ipmidi_base_port_spinner, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
-
+
ipmidi_base_port_spinner.set_sensitive (_cp.device_info().uses_ipmidi());
ipmidi_base_port_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::ipmidi_spinner_changed));
-
+
/* leave an extra blank row */
row++;
@@ -164,7 +164,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
touch_sensitivity_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::touch_sensitive_change));
touch_sensitivity_scale.set_update_policy (Gtk::UPDATE_DISCONTINUOUS);
-
+
l = manage (new Gtk::Label (_("Button click")));
l->set_alignment (1.0, 0.5);
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
@@ -173,7 +173,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
align->add (relay_click_button);
table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
-
+
l = manage (new Gtk::Label (_("Backlight")));
l->set_alignment (1.0, 0.5);
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
@@ -182,7 +182,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
align->add (backlight_button);
table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
-
+
l = manage (new Gtk::Label (_("Send Fader Position Only When Touched")));
l->set_alignment (1.0, 0.5);
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
@@ -191,7 +191,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
align->add (absolute_touch_mode_button);
table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
-
+
l = manage (new Gtk::Label (_("Send Fader Position When Moved")));
l->set_alignment (1.0, 0.5);
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
@@ -200,7 +200,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
align->add (touch_move_mode_button);
table->attach (*align, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
-
+
l = manage (new Gtk::Label (_("Fader Touch Sense Sensitivity")));
l->set_alignment (1.0, 0.5);
table->attach (*l, 0, 1, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
@@ -209,14 +209,14 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
table->attach (touch_sensitivity_scale, 1, 2, 5, 6, AttachOptions(FILL|EXPAND), AttachOptions (0));
table->attach (recalibrate_fader_button, row, row+1, 6, 7, AttachOptions(FILL|EXPAND), AttachOptions (0));
row++;
-
+
table->attach (discover_button, 1, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions (0));
discover_button.signal_clicked().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::discover_clicked));
row++;
-
+
vector<string> profiles;
-
+
profiles.push_back ("default");
for (std::map<std::string,DeviceProfile>::iterator i = DeviceProfile::device_profiles.begin(); i != DeviceProfile::device_profiles.end(); ++i) {
@@ -234,13 +234,13 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
VBox* fkey_packer = manage (new VBox);
HBox* profile_packer = manage (new HBox);
HBox* observation_packer = manage (new HBox);
-
+
l = manage (new Gtk::Label (_("Profile/Settings:")));
profile_packer->pack_start (*l, false, false);
profile_packer->pack_start (_profile_combo, true, true);
profile_packer->set_spacing (12);
profile_packer->set_border_width (12);
-
+
l = manage (new Gtk::Label (_("* Button available at the original Mackie MCU PRO or current device if enabled (NOT implemented yet). Device specific name presented.")));
observation_packer->pack_start (*l, false, false);
@@ -322,7 +322,7 @@ MackieControlProtocolGUI::build_available_action_menu ()
parent = *(rowp);
parent[available_action_columns.name] = _("CmdAlt");
-
+
for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) {
TreeModel::Row row;
@@ -395,7 +395,7 @@ MackieControlProtocolGUI::build_function_key_editor ()
col = manage (new TreeViewColumn (_("Plain"), *renderer));
col->add_attribute (renderer->property_text(), function_key_columns.plain);
function_key_editor.append_column (*col);
-
+
renderer = make_action_renderer (available_action_model, function_key_columns.shift);
col = manage (new TreeViewColumn (_("Shift"), *renderer));
col->add_attribute (renderer->property_text(), function_key_columns.shift);
@@ -461,7 +461,7 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
/* Probably a key alias */
row[function_key_columns.plain] = action;
} else {
-
+
act = ActionManager::get_action (action.c_str());
if (act) {
row[function_key_columns.plain] = act->get_label();
@@ -569,7 +569,7 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib
if (row) {
std::map<std::string,std::string>::iterator i = action_map.find (text);
-
+
if (i == action_map.end()) {
if (!remove) {
return;
diff --git a/libs/surfaces/mackie/gui.h b/libs/surfaces/mackie/gui.h
index 7927d106b0..2bc17d306b 100644
--- a/libs/surfaces/mackie/gui.h
+++ b/libs/surfaces/mackie/gui.h
@@ -41,14 +41,14 @@ class MackieControlProtocolGUI : public Gtk::Notebook
{
public:
MackieControlProtocolGUI (MackieControlProtocol &);
-
+
private:
MackieControlProtocol& _cp;
Gtk::ComboBoxText _surface_combo;
Gtk::ComboBoxText _profile_combo;
Gtk::ComboBoxText _input_port_combo;
Gtk::ComboBoxText _output_port_combo;
-
+
struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord {
AvailableActionColumns() {
add (name);
diff --git a/libs/surfaces/mackie/interface.cc b/libs/surfaces/mackie/interface.cc
index bb0a4d0509..1a9760bcbe 100644
--- a/libs/surfaces/mackie/interface.cc
+++ b/libs/surfaces/mackie/interface.cc
@@ -35,7 +35,7 @@ static ControlProtocol*
new_mackie_protocol (ControlProtocolDescriptor*, Session* s)
{
MackieControlProtocol* mcp = 0;
-
+
try {
mcp = new MackieControlProtocol (*s);
/* do not set active here - wait for set_state() */
@@ -45,7 +45,7 @@ new_mackie_protocol (ControlProtocolDescriptor*, Session* s)
delete mcp;
mcp = 0;
}
-
+
return mcp;
}
@@ -90,6 +90,6 @@ static ControlProtocolDescriptor mackie_descriptor = {
/*initialize : */ new_mackie_protocol,
/*destroy : */ delete_mackie_protocol
};
-
+
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &mackie_descriptor; }
diff --git a/libs/surfaces/mackie/jog_wheel.h b/libs/surfaces/mackie/jog_wheel.h
index 568589e54d..f54e3efeb3 100644
--- a/libs/surfaces/mackie/jog_wheel.h
+++ b/libs/surfaces/mackie/jog_wheel.h
@@ -18,7 +18,7 @@ class JogWheel
{
public:
enum Mode { scroll };
-
+
JogWheel (MackieControlProtocol & mcp);
/// As the wheel turns...
diff --git a/libs/surfaces/mackie/led.cc b/libs/surfaces/mackie/led.cc
index d103829a77..59b9f6cb20 100644
--- a/libs/surfaces/mackie/led.cc
+++ b/libs/surfaces/mackie/led.cc
@@ -48,18 +48,18 @@ Led::set_state (LedState new_state)
MIDI::byte msg = 0;
switch (state.state()) {
- case LedState::on:
+ case LedState::on:
msg = 0x7f;
break;
- case LedState::off:
+ case LedState::off:
msg = 0x00;
break;
- case LedState::flashing:
+ case LedState::flashing:
msg = 0x01;
break;
- case LedState::none:
+ case LedState::none:
return MidiByteArray ();
}
-
+
return MidiByteArray (3, 0x90, id(), msg);
}
diff --git a/libs/surfaces/mackie/led.h b/libs/surfaces/mackie/led.h
index 8361c4bb8d..19c48cb6a8 100644
--- a/libs/surfaces/mackie/led.h
+++ b/libs/surfaces/mackie/led.h
@@ -42,12 +42,12 @@ public:
, state (off)
{
}
-
+
Led & led() { return *this; }
MidiByteArray set_state (LedState);
MidiByteArray zero() { return set_state (off); }
-
+
static Control* factory (Surface&, int id, const char*, Group&);
private:
diff --git a/libs/surfaces/mackie/mackie_control_exception.h b/libs/surfaces/mackie/mackie_control_exception.h
index b40c5c3915..6dcca3dd39 100644
--- a/libs/surfaces/mackie/mackie_control_exception.h
+++ b/libs/surfaces/mackie/mackie_control_exception.h
@@ -30,14 +30,14 @@ public:
: _msg( msg )
{
}
-
+
virtual ~MackieControlException() throw () {}
-
+
const char * what() const throw ()
{
return _msg.c_str();
}
-
+
private:
std::string _msg;
};
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index ac1ba53896..0536a0c764 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -118,12 +118,12 @@ class MackieControlProtocol
Swap, /* fader controls secondary, vpot controls primary */
Zero, /* fader controls primary, but doesn't move, vpot controls secondary */
};
-
+
MackieControlProtocol(ARDOUR::Session &);
virtual ~MackieControlProtocol();
static MackieControlProtocol* instance() { return _instance; }
-
+
const Mackie::DeviceInfo& device_info() const { return _device_info; }
Mackie::DeviceProfile& device_profile() { return _device_profile; }
@@ -148,9 +148,9 @@ class MackieControlProtocol
we do not implement get/set_feedback() since this aspect of
support for the protocol is not optional.
*/
-
+
static bool probe();
-
+
Glib::Threads::Mutex surfaces_lock;
typedef std::list<boost::shared_ptr<Mackie::Surface> > Surfaces;
Surfaces surfaces;
@@ -159,9 +159,9 @@ class MackieControlProtocol
void set_master_on_surface_strip (uint32_t surface, uint32_t strip);
void set_monitor_on_surface_strip (uint32_t surface, uint32_t strip);
-
+
uint32_t n_strips (bool with_locked_strips = true) const;
-
+
bool has_editor () const { return true; }
void* get_gui () const;
void tear_down_gui ();
@@ -174,7 +174,7 @@ class MackieControlProtocol
void recalibrate_faders ();
void toggle_backlight ();
void set_touch_sensitivity (int);
-
+
/// rebuild the current bank. Called on route added/removed and
/// remote id changed.
void refresh_current_bank();
@@ -191,7 +191,7 @@ class MackieControlProtocol
/// Turn timecode on and beats off, or vice versa, depending
/// on state of _timecode_type
void update_timecode_beats_led();
-
+
/// this is called to generate the midi to send in response to a button press.
void update_led(Mackie::Surface&, Mackie::Button & button, Mackie::LedState);
@@ -209,7 +209,7 @@ class MackieControlProtocol
void add_down_button (ARDOUR::AutomationType, int surface, int strip);
void remove_down_button (ARDOUR::AutomationType, int surface, int strip);
ControlList down_controls (ARDOUR::AutomationType);
-
+
void add_down_select_button (int surface, int strip);
void remove_down_select_button (int surface, int strip);
void select_range ();
@@ -221,7 +221,7 @@ class MackieControlProtocol
void not_session_load () { _session_load = false; }
void midi_connectivity_established ();
-
+
protected:
// shut down the surface
void close();
@@ -229,14 +229,14 @@ class MackieControlProtocol
// This sets up the notifications and sets the
// controls to the correct values
void update_surfaces();
-
+
// connects global (not strip) signals from the Session to here
// so the surface can be notified of changes from the other UIs.
void connect_session_signals();
-
+
// set all controls to their zero position
void zero_all();
-
+
/**
Fetch the set of routes to be considered for control by the
surface. Excluding master, hidden and control routes, and inactive routes
@@ -254,7 +254,7 @@ class MackieControlProtocol
std::string format_bbt_timecode (ARDOUR::framepos_t now_frame);
std::string format_timecode_timecode (ARDOUR::framepos_t now_frame);
-
+
void do_request (MackieControlUIRequest*);
int stop ();
@@ -267,7 +267,7 @@ class MackieControlProtocol
struct ButtonHandlers {
Mackie::LedState (MackieControlProtocol::*press) (Mackie::Button&);
Mackie::LedState (MackieControlProtocol::*release) (Mackie::Button&);
-
+
ButtonHandlers (Mackie::LedState (MackieControlProtocol::*p) (Mackie::Button&),
Mackie::LedState (MackieControlProtocol::*r) (Mackie::Button&))
: press (p)
@@ -277,7 +277,7 @@ class MackieControlProtocol
typedef std::map<Mackie::Button::ID,ButtonHandlers> ButtonMap;
static MackieControlProtocol* _instance;
-
+
Mackie::DeviceInfo _device_info;
Mackie::DeviceProfile _device_profile;
sigc::connection periodic_connection;
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index c2d3680ff0..5bf52ce4c4 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -189,7 +189,7 @@ LedState
MackieControlProtocol::cursor_right_press (Button& )
{
if (zoom_mode()) {
-
+
if (main_modifier_state() & MODIFIER_OPTION) {
/* reset selected tracks to default vertical zoom */
} else {
@@ -209,7 +209,7 @@ MackieControlProtocol::cursor_right_press (Button& )
ScrollTimeline (page_fraction);
}
-
+
return off;
}
@@ -223,7 +223,7 @@ LedState
MackieControlProtocol::cursor_up_press (Button&)
{
if (zoom_mode()) {
-
+
if (main_modifier_state() & MODIFIER_CONTROL) {
VerticalZoomInSelected (); /* EMIT SIGNAL */
} else {
diff --git a/libs/surfaces/mackie/meter.cc b/libs/surfaces/mackie/meter.cc
index 91de8d6ef6..27171aff16 100644
--- a/libs/surfaces/mackie/meter.cc
+++ b/libs/surfaces/mackie/meter.cc
@@ -43,24 +43,24 @@ Meter::factory (Surface& surface, int id, const char* name, Group& group)
void
Meter::notify_metering_state_changed(Surface& surface, bool transport_is_rolling, bool metering_active)
-{
+{
MidiByteArray msg;
-
+
// sysex header
msg << surface.sysex_hdr();
-
+
// code for Channel Meter Enable Message
msg << 0x20;
-
+
// Channel identification
msg << id();
-
+
// Enable (0x07) / Disable (0x00) level meter on LCD, peak hold display on horizontal meter and signal LED
msg << ((transport_is_rolling && metering_active) ? 0x07 : 0x00);
-
+
// sysex trailer
msg << MIDI::eox;
-
+
surface.write (msg);
}
@@ -70,7 +70,7 @@ Meter::send_update (Surface& surface, float dB)
float def = 0.0f; /* Meter deflection %age */
// DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Meter ID %1 dB %2\n", id(), dB));
-
+
if (dB < -70.0f) {
def = 0.0f;
} else if (dB < -60.0f) {
@@ -88,19 +88,19 @@ Meter::send_update (Surface& surface, float dB)
} else {
def = 115.0f;
}
-
+
/* 115 is the deflection %age that would be
when dB=6.0. this is an arbitrary
endpoint for our scaling.
*/
MidiByteArray msg;
-
+
if (def > 100.0f) {
if (!overload_on) {
overload_on = true;
surface.write (MidiByteArray (2, 0xd0, (id() << 4) | 0xe));
-
+
}
} else {
if (overload_on) {
@@ -108,11 +108,11 @@ Meter::send_update (Surface& surface, float dB)
surface.write (MidiByteArray (2, 0xd0, (id() << 4) | 0xf));
}
}
-
+
/* we can use up to 13 segments */
int segment = lrintf ((def/115.0) * 13.0);
-
+
surface.write (MidiByteArray (2, 0xd0, (id()<<4) | segment));
}
diff --git a/libs/surfaces/mackie/meter.h b/libs/surfaces/mackie/meter.h
index 1cbeeac0af..9a5d88ed23 100644
--- a/libs/surfaces/mackie/meter.h
+++ b/libs/surfaces/mackie/meter.h
@@ -35,7 +35,7 @@ public:
Meter (int id, std::string name, Group & group)
: Control (id, name, group)
, overload_on (false) {}
-
+
void send_update (Surface&, float dB);
MidiByteArray zero();
diff --git a/libs/surfaces/mackie/midi_byte_array.cc b/libs/surfaces/mackie/midi_byte_array.cc
index 1e94e781c0..ffb94a03a9 100644
--- a/libs/surfaces/mackie/midi_byte_array.cc
+++ b/libs/surfaces/mackie/midi_byte_array.cc
@@ -34,7 +34,7 @@ MidiByteArray::MidiByteArray (size_t size, MIDI::byte array[])
for (size_t i = 0; i < size; ++i)
{
push_back (array[i]);
- }
+ }
}
MidiByteArray::MidiByteArray (size_t count, MIDI::byte first, ...)
diff --git a/libs/surfaces/mackie/midi_byte_array.h b/libs/surfaces/mackie/midi_byte_array.h
index 372e48ab90..3d3bcecd28 100644
--- a/libs/surfaces/mackie/midi_byte_array.h
+++ b/libs/surfaces/mackie/midi_byte_array.h
@@ -49,14 +49,14 @@ class MidiByteArray : public std::vector<MIDI::byte>
{
public:
MidiByteArray() : std::vector<MIDI::byte>() {}
-
+
MidiByteArray( size_t count, MIDI::byte array[] );
/**
Accepts a preceding count, and then a list of bytes
*/
MidiByteArray( size_t count, MIDI::byte first, ... );
-
+
/// copy the given number of bytes from the given array
void copy( size_t count, MIDI::byte arr[] );
};
diff --git a/libs/surfaces/mackie/pot.cc b/libs/surfaces/mackie/pot.cc
index e1ddae82f8..3ac991116f 100644
--- a/libs/surfaces/mackie/pot.cc
+++ b/libs/surfaces/mackie/pot.cc
@@ -45,7 +45,7 @@ Pot::set (float val, bool onoff, Mode mode)
// center on if val is "very close" to 0.50
MIDI::byte msg = (val > 0.48 && val < 0.58 ? 1 : 0) << 6;
-
+
// Pot/LED mode
msg |= (mode << 4);
@@ -57,7 +57,7 @@ Pot::set (float val, bool onoff, Mode mode)
if (val < 0){
val = val * -1;
}
-
+
// val, but only if off hasn't explicitly been set
if (onoff) {
if (mode == spread) {
@@ -73,4 +73,4 @@ Pot::set (float val, bool onoff, Mode mode)
return MidiByteArray (3, 0xb0, 0x20 + id(), msg);
}
-
+
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index ca5c79e9e0..4528e7b155 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -111,7 +111,7 @@ Strip::Strip (Surface& s, const std::string& name, int index, const map<Button::
_surface->number(), index, Button::id_to_name (bb->bid()),
bb->id(), b->second.base_id));
}
-}
+}
Strip::~Strip ()
{
@@ -161,7 +161,7 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
}
route_connections.drop_connections ();
-
+
_solo->set_control (boost::shared_ptr<AutomationControl>());
_mute->set_control (boost::shared_ptr<AutomationControl>());
_select->set_control (boost::shared_ptr<AutomationControl>());
@@ -181,12 +181,12 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface %1 strip %2 now mapping route %3\n",
_surface->number(), _index, _route->name()));
-
+
_solo->set_control (_route->solo_control());
_mute->set_control (_route->mute_control());
set_vpot_parameter (PanAzimuthAutomation);
-
+
_route->solo_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
_route->listen_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
@@ -200,28 +200,28 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
}
_route->gain_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context());
_route->PropertyChanged.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context());
-
+
boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<ARDOUR::Track>(_route);
-
+
if (trk) {
_recenable->set_control (trk->rec_enable_control());
trk->rec_enable_control()->Changed .connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_record_enable_changed, this), ui_context());
-
+
}
-
+
// TODO this works when a currently-banked route is made inactive, but not
// when a route is activated which should be currently banked.
-
+
_route->active_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_active_changed, this), ui_context());
_route->DropReferences.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_route_deleted, this), ui_context());
-
+
/* Update */
-
+
notify_all ();
/* setup legal VPot modes for this route */
-
+
build_input_list (_route->input()->n_ports());
build_output_list (_route->output()->n_ports());
@@ -232,11 +232,11 @@ Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
if (panner) {
set<Evoral::Parameter> automatable = panner->what_can_be_automated ();
set<Evoral::Parameter>::iterator a;
-
+
if ((a = automatable.find (PanAzimuthAutomation)) != automatable.end()) {
possible_pot_parameters.push_back (PanAzimuthAutomation);
}
-
+
if ((a = automatable.find (PanWidthAutomation)) != automatable.end()) {
possible_pot_parameters.push_back (PanWidthAutomation);
}
@@ -305,7 +305,7 @@ void
Strip::notify_gain_changed (bool force_update)
{
if (_route) {
-
+
Control* control;
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
@@ -315,13 +315,13 @@ Strip::notify_gain_changed (bool force_update)
}
boost::shared_ptr<AutomationControl> ac = _route->gain_control();
-
+
float gain_coefficient = ac->get_value();
float normalized_position = ac->internal_to_interface (gain_coefficient);
if (force_update || normalized_position != _last_gain_position_written) {
-
+
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
if (!control->in_use()) {
_surface->write (_vpot->set (normalized_position, true, Pot::wrap));
@@ -350,13 +350,13 @@ Strip::notify_property_changed (const PropertyChange& what_changed)
if (_route) {
string line1;
string fullname = _route->name();
-
+
if (fullname.length() <= 6) {
line1 = fullname;
} else {
line1 = PBD::short_version (fullname, 6);
}
-
+
_surface->write (display (0, line1));
}
}
@@ -382,7 +382,7 @@ Strip::notify_panner_azi_changed (bool force_update)
}
double pos = pannable->pan_azimuth_control->internal_to_interface (pannable->pan_azimuth_control->get_value());
-
+
if (force_update || pos != _last_pan_azi_position_written) {
if (control == _fader) {
@@ -392,7 +392,7 @@ Strip::notify_panner_azi_changed (bool force_update)
} else if (control == _vpot) {
_surface->write (_vpot->set (pos, true, Pot::dot));
}
-
+
queue_parameter_display (PanAzimuthAutomation, pos);
queue_display_reset (2000);
_last_pan_azi_position_written = pos;
@@ -419,12 +419,12 @@ Strip::notify_panner_width_changed (bool force_update)
if (!control) {
return;
- }
-
+ }
+
double pos = pannable->pan_width_control->internal_to_interface (pannable->pan_width_control->get_value());
-
+
if (force_update || pos != _last_pan_azi_position_written) {
-
+
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
if (control == _fader) {
@@ -436,7 +436,7 @@ Strip::notify_panner_width_changed (bool force_update)
} else if (control == _vpot) {
_surface->write (_vpot->set (pos, true, Pot::spread));
}
-
+
queue_parameter_display (PanWidthAutomation, pos);
queue_display_reset (2000);
_last_pan_azi_position_written = pos;
@@ -448,9 +448,9 @@ void
Strip::select_event (Button&, ButtonState bs)
{
DEBUG_TRACE (DEBUG::MackieControl, "select button\n");
-
+
if (bs == press) {
-
+
int ms = _surface->mcp().main_modifier_state();
if (ms & MackieControlProtocol::MODIFIER_CMDALT) {
@@ -459,7 +459,7 @@ Strip::select_event (Button&, ButtonState bs)
queue_display_reset (1000);
return;
}
-
+
if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
/* reset to default */
boost::shared_ptr<AutomationControl> ac = _fader->control ();
@@ -468,14 +468,14 @@ Strip::select_event (Button&, ButtonState bs)
}
return;
}
-
+
DEBUG_TRACE (DEBUG::MackieControl, "add select button on press\n");
- _surface->mcp().add_down_select_button (_surface->number(), _index);
+ _surface->mcp().add_down_select_button (_surface->number(), _index);
_surface->mcp().select_range ();
-
+
} else {
DEBUG_TRACE (DEBUG::MackieControl, "remove select button on release\n");
- _surface->mcp().remove_down_select_button (_surface->number(), _index);
+ _surface->mcp().remove_down_select_button (_surface->number(), _index);
}
}
@@ -485,13 +485,13 @@ Strip::vselect_event (Button&, ButtonState bs)
if (bs == press) {
int ms = _surface->mcp().main_modifier_state();
-
+
if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
boost::shared_ptr<AutomationControl> ac = _vpot->control ();
-
+
if (ac) {
-
+
/* reset to default/normal value */
ac->set_value (ac->normal());
}
@@ -509,7 +509,7 @@ void
Strip::fader_touch_event (Button&, ButtonState bs)
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader touch, press ? %1\n", (bs == press)));
-
+
if (bs == press) {
boost::shared_ptr<AutomationControl> ac = _fader->control ();
@@ -522,20 +522,20 @@ Strip::fader_touch_event (Button&, ButtonState bs)
_fader->set_in_use (true);
_fader->start_touch (_surface->mcp().transport_frame());
-
+
if (ac) {
queue_parameter_display ((AutomationType) ac->parameter().type(), ac->internal_to_interface (ac->get_value()));
queue_display_reset (2000);
}
}
-
+
} else {
-
+
_fader->set_in_use (false);
_fader->stop_touch (_surface->mcp().transport_frame(), true);
-
+
}
-}
+}
void
@@ -550,12 +550,12 @@ Strip::handle_button (Button& button, ButtonState bs)
}
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip %1 handling button %2 press ? %3\n", _index, button.bid(), (bs == press)));
-
+
switch (button.bid()) {
case Button::Select:
select_event (button, bs);
break;
-
+
case Button::VSelect:
vselect_event (button, bs);
break;
@@ -569,34 +569,34 @@ Strip::handle_button (Button& button, ButtonState bs)
if (bs == press) {
DEBUG_TRACE (DEBUG::MackieControl, "add button on press\n");
_surface->mcp().add_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index);
-
+
float new_value;
int ms = _surface->mcp().main_modifier_state();
-
+
if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
/* reset to default/normal value */
new_value = control->normal();
} else {
new_value = control->get_value() ? 0.0 : 1.0;
}
-
+
/* get all controls that either have their
* button down or are within a range of
* several down buttons
*/
-
+
MackieControlProtocol::ControlList controls = _surface->mcp().down_controls ((AutomationType) control->parameter().type());
-
-
+
+
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("there are %1 buttons down for control type %2, new value = %3\n",
controls.size(), control->parameter().type(), new_value));
/* apply change */
-
+
for (MackieControlProtocol::ControlList::iterator c = controls.begin(); c != controls.end(); ++c) {
(*c)->set_value (new_value);
}
-
+
} else {
DEBUG_TRACE (DEBUG::MackieControl, "remove button on release\n");
_surface->mcp().remove_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index);
@@ -629,7 +629,7 @@ Strip::do_parameter_display (AutomationType type, float val)
float dB = accurate_coefficient_to_dB (val);
snprintf (buf, sizeof (buf), "%6.1f", dB);
_surface->write (display (1, buf));
- }
+ }
break;
case PanAzimuthAutomation:
@@ -691,7 +691,7 @@ Strip::handle_pot (Pot& pot, float delta)
/* Pots only emit events when they move, not when they
stop moving. So to get a stop event, we need to use a timeout.
*/
-
+
boost::shared_ptr<AutomationControl> ac = pot.control();
double p = pot.get_value ();
p += delta;
@@ -786,12 +786,12 @@ Strip::display (uint32_t line_number, const std::string& line)
// sysex header
retval << _surface->sysex_hdr();
-
+
// code for display
retval << 0x12;
// offset (0 to 0x37 first line, 0x38 to 0x6f for second line)
retval << (_index * 7 + (line_number * 0x38));
-
+
// ascii data to display. @param line is UTF-8
string ascii = Glib::convert_with_fallback (line, "UTF-8", "ISO-8859-1", "_");
string::size_type len = ascii.length();
@@ -804,7 +804,7 @@ Strip::display (uint32_t line_number, const std::string& line)
for (int i = len; i < 6; ++i) {
retval << ' ';
}
-
+
// column spacer, unless it's the right-hand column
if (_index < 7) {
retval << ' ';
@@ -812,7 +812,7 @@ Strip::display (uint32_t line_number, const std::string& line)
// sysex trailer
retval << MIDI::eox;
-
+
return retval;
}
@@ -845,7 +845,7 @@ string
Strip::vpot_mode_string () const
{
boost::shared_ptr<AutomationControl> ac = _vpot->control();
-
+
if (!ac) {
return string();
}
@@ -900,10 +900,10 @@ Strip::queue_display_reset (uint32_t msecs)
struct timeval delta;
struct timeval when;
gettimeofday (&now, 0);
-
+
delta.tv_sec = msecs/1000;
delta.tv_usec = (msecs - ((msecs/1000) * 1000)) * 1000;
-
+
timeradd (&now, &delta, &when);
_reset_display_at = (when.tv_sec * 1000000) + when.tv_usec;
@@ -923,10 +923,10 @@ Strip::reset_display ()
} else {
_surface->write (blank_display (1));
}
-
+
clear_display_reset ();
}
-
+
struct RouteCompareByName {
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
return a->name().compare (b->name()) < 0;
@@ -951,19 +951,19 @@ Strip::build_input_list (const ChanCount& channels)
input_bundles.clear ();
/* give user bundles first chance at being in the menu */
-
+
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
maybe_add_to_bundle_map (input_bundles, *i, true, channels);
}
}
-
+
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
maybe_add_to_bundle_map (input_bundles, *i, true, channels);
}
}
-
+
boost::shared_ptr<ARDOUR::RouteList> routes = _surface->mcp().get_session().get_routes ();
RouteList copy = *routes;
copy.sort (RouteCompareByName ());
@@ -982,19 +982,19 @@ Strip::build_output_list (const ChanCount& channels)
output_bundles.clear ();
/* give user bundles first chance at being in the menu */
-
+
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
if (boost::dynamic_pointer_cast<UserBundle> (*i)) {
maybe_add_to_bundle_map (output_bundles, *i, false, channels);
}
}
-
+
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {
if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) {
maybe_add_to_bundle_map (output_bundles, *i, false, channels);
}
}
-
+
boost::shared_ptr<ARDOUR::RouteList> routes = _surface->mcp().get_session().get_routes ();
RouteList copy = *routes;
copy.sort (RouteCompareByName ());
@@ -1141,21 +1141,21 @@ Strip::notify_metering_state_changed()
if (!_route || !_meter) {
return;
}
-
+
bool transport_is_rolling = (_surface->mcp().get_transport_speed () != 0.0f);
bool metering_active = _surface->mcp().metering_active ();
-
+
if ((_transport_is_rolling == transport_is_rolling) && (_metering_active == metering_active)) {
return;
}
-
+
_meter->notify_metering_state_changed (*_surface, transport_is_rolling, metering_active);
-
+
if (!transport_is_rolling || !metering_active) {
notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::name));
notify_panner_azi_changed (true);
}
-
+
_transport_is_rolling = transport_is_rolling;
_metering_active = metering_active;
}
diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h
index 4099dce8af..c2cbfc2ee6 100644
--- a/libs/surfaces/mackie/strip.h
+++ b/libs/surfaces/mackie/strip.h
@@ -56,7 +56,7 @@ public:
void add (Control & control);
int index() const { return _index; } // zero based
-
+
void set_route (boost::shared_ptr<ARDOUR::Route>, bool with_messages = true);
// call all signal handlers manually
@@ -117,7 +117,7 @@ private:
void notify_panner_width_changed (bool force_update = true);
void notify_active_changed ();
void notify_route_deleted ();
-
+
void update_automation ();
void update_meter ();
@@ -136,7 +136,7 @@ private:
void do_parameter_display (ARDOUR::AutomationType, float val);
void queue_parameter_display (ARDOUR::AutomationType, float val);
-
+
typedef std::map<std::string,boost::shared_ptr<ARDOUR::Bundle> > BundleMap;
BundleMap input_bundles;
BundleMap output_bundles;
diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc
index 51b03f86a3..5bbb081487 100644
--- a/libs/surfaces/mackie/surface.cc
+++ b/libs/surfaces/mackie/surface.cc
@@ -90,7 +90,7 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
, _last_master_gain_written (-0.0f)
{
DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface init\n");
-
+
try {
_port = new SurfacePort (*this);
} catch (...) {
@@ -114,12 +114,12 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
}
uint32_t n = _mcp.device_info().strip_cnt();
-
+
if (n) {
init_strips (n);
DEBUG_TRACE (DEBUG::MackieControl, "init_strips done\n");
}
-
+
connect_to_signals ();
DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface done\n");
@@ -135,12 +135,12 @@ Surface::~Surface ()
for (Groups::iterator it = groups.begin(); it != groups.end(); ++it) {
delete it->second;
}
-
+
// delete controls
for (Controls::iterator it = controls.begin(); it != controls.end(); ++it) {
delete *it;
}
-
+
delete _jog_wheel;
delete _port;
@@ -205,7 +205,7 @@ void
Surface::init_controls()
{
Group* group;
-
+
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating groups\n");
groups["assignment"] = new Group ("assignment");
groups["automation"] = new Group ("automation");
@@ -220,7 +220,7 @@ Surface::init_controls()
groups["transport"] = new Group ("transport");
groups["user"] = new Group ("user");
groups["utilities"] = new Group ("utilities");
-
+
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating jog wheel\n");
if (_mcp.device_info().has_jog_wheel()) {
_jog_wheel = new Mackie::JogWheel (_mcp);
@@ -251,11 +251,11 @@ Surface::init_strips (uint32_t n)
for (uint32_t i = 0; i < n; ++i) {
char name[32];
-
+
snprintf (name, sizeof (name), "strip_%d", (8* _number) + i);
Strip* strip = new Strip (*this, name, i, strip_buttons);
-
+
groups[name] = strip;
strips.push_back (strip);
}
@@ -265,17 +265,17 @@ void
Surface::setup_master ()
{
boost::shared_ptr<Route> m;
-
+
if ((m = _mcp.get_session().monitor_out()) == 0) {
m = _mcp.get_session().master_out();
}
-
+
if (!m) {
return;
}
_master_fader = dynamic_cast<Fader*> (Fader::factory (*this, _mcp.device_info().strip_cnt(), "master", *groups["master"]));
-
+
_master_fader->set_control (m->gain_control());
m->gain_control()->Changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&Surface::master_gain_changed, this), ui_context());
@@ -384,7 +384,7 @@ Surface::connect_to_signals ()
}
// Master fader
p->channel_pitchbend[_mcp.device_info().strip_cnt()].connect_same_thread (*this, boost::bind (&Surface::handle_midi_pitchbend_message, this, _1, _2, _mcp.device_info().strip_cnt()));
-
+
_connected = true;
}
}
@@ -402,7 +402,7 @@ Surface::handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t pb, uin
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::handle_midi_pitchbend_message on port %3, fader = %1 value = %2 (%4)\n",
fader_id, pb, _number, pb/16384.0));
-
+
if (_mcp.device_info().no_handshake()) {
turn_it_on ();
}
@@ -437,7 +437,7 @@ void
Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::handle_midi_note_on_message %1 = %2\n", (int) ev->note_number, (int) ev->velocity));
-
+
if (_mcp.device_info().no_handshake()) {
turn_it_on ();
}
@@ -445,7 +445,7 @@ Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
if (_mcp.device_info().device_type() == DeviceInfo::HUI && ev->note_number == 0 && ev->velocity == 127) {
turn_it_on ();
}
-
+
/* fader touch sense is given by "buttons" 0xe..0xe7 and 0xe8 for the
* master.
*/
@@ -516,7 +516,7 @@ Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev
} else {
delta = sign * (ticks / (float) 0x3f);
}
-
+
if (!pot) {
if (ev->controller_number == Jog::ID && _jog_wheel) {
@@ -595,16 +595,16 @@ calculate_challenge_response (MidiByteArray::iterator begin, MidiByteArray::iter
MidiByteArray l;
back_insert_iterator<MidiByteArray> back (l);
copy (begin, end, back);
-
+
MidiByteArray retval;
-
+
// this is how to calculate the response to the challenge.
// from the Logic docs.
retval << (0x7f & (l[0] + (l[1] ^ 0xa) - l[3]));
retval << (0x7f & ( (l[2] >> l[3]) ^ (l[0] + l[3])));
retval << (0x7f & ((l[3] - (l[2] << 2)) ^ (l[0] | l[1])));
retval << (0x7f & (l[1] - l[2] + (0xf0 ^ (l[3] << 4))));
-
+
return retval;
}
@@ -613,7 +613,7 @@ MidiByteArray
Surface::host_connection_query (MidiByteArray & bytes)
{
MidiByteArray response;
-
+
if (bytes[4] != 0x10 && bytes[4] != 0x11) {
/* not a Logic Control device - no response required */
return response;
@@ -621,7 +621,7 @@ Surface::host_connection_query (MidiByteArray & bytes)
// handle host connection query
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("host connection query: %1\n", bytes));
-
+
if (bytes.size() != 18) {
cerr << "expecting 18 bytes, read " << bytes << " from " << _port->input_port().name() << endl;
return response;
@@ -639,14 +639,14 @@ MidiByteArray
Surface::host_connection_confirmation (const MidiByteArray & bytes)
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("host_connection_confirmation: %1\n", bytes));
-
+
// decode host connection confirmation
if (bytes.size() != 14) {
ostringstream os;
os << "expecting 14 bytes, read " << bytes << " from " << _port->input_port().name();
throw MackieControlException (os.str());
}
-
+
// send version request
return MidiByteArray (2, 0x13, 0x00);
}
@@ -725,7 +725,7 @@ Surface::zero_all ()
if (_mcp.device_info().has_timecode_display ()) {
display_timecode (string (10, '0'), string (10, ' '));
}
-
+
if (_mcp.device_info().has_two_character_display()) {
show_two_char_display (string (2, '0'), string (2, ' '));
}
@@ -839,13 +839,13 @@ Surface::show_two_char_display (const std::string & msg, const std::string & dot
if (_stype != mcu || !_mcp.device_info().has_two_character_display() || msg.length() != 2 || dots.length() != 2) {
return;
}
-
+
MidiByteArray right (3, 0xb0, 0x4b, 0x00);
MidiByteArray left (3, 0xb0, 0x4a, 0x00);
-
+
right[2] = translate_seven_segment (msg[0]) + (dots[0] == '.' ? 0x40 : 0x00);
left[2] = translate_seven_segment (msg[1]) + (dots[1] == '.' ? 0x40 : 0x00);
-
+
_port->write (right);
_port->write (left);
}
@@ -866,7 +866,7 @@ Surface::display_timecode (const std::string & timecode, const std::string & las
}
// if there's no change, send nothing, not even sysex header
if (timecode == last_timecode) return;
-
+
// length sanity checking
string local_timecode = timecode;
@@ -879,7 +879,7 @@ Surface::display_timecode (const std::string & timecode, const std::string & las
while (local_timecode.length() < 10) {
local_timecode += " ";
}
-
+
// translate characters.
// Only the characters that actually changed are sent.
int position = 0x3f;
@@ -949,7 +949,7 @@ Surface::update_view_mode_display ()
}
if (id >= 0) {
-
+
/* we are attempting to turn a global button/LED on */
map<int,Control*>::iterator x = controls_by_device_independent_id.find (id);
@@ -999,7 +999,7 @@ Surface::next_jog_mode ()
void
Surface::set_jog_mode (JogWheel::Mode)
{
-}
+}
bool
Surface::route_is_locked_to_strip (boost::shared_ptr<Route> r) const
@@ -1065,13 +1065,13 @@ Surface::recalibrate_faders ()
msg[4] = 0x11; /* reset Logic Control XT */
_port->write (msg);
}
-}
+}
void
Surface::set_touch_sensitivity (int sensitivity)
{
/* NOTE: assumed called from GUI code, hence sleep() */
-
+
/* sensitivity already clamped by caller */
if (_port) {
diff --git a/libs/surfaces/mackie/surface.h b/libs/surfaces/mackie/surface.h
index 7ca620d3b6..1c989ec518 100644
--- a/libs/surfaces/mackie/surface.h
+++ b/libs/surfaces/mackie/surface.h
@@ -62,7 +62,7 @@ public:
std::map<int,Led*> leds;
std::map<int,Meter*> meters;
std::map<int,Control*> controls_by_device_independent_id;
-
+
Mackie::JogWheel* jog_wheel() const { return _jog_wheel; }
Fader* master_fader() const { return _master_fader; }
@@ -88,7 +88,7 @@ public:
void periodic (uint64_t now_usecs);
void redisplay ();
void hui_heartbeat ();
-
+
void handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t, uint32_t channel_id);
void handle_midi_controller_message (MIDI::Parser&, MIDI::EventTwoBytes*);
void handle_midi_note_on_message (MIDI::Parser&, MIDI::EventTwoBytes*);
@@ -105,7 +105,7 @@ public:
/// display an indicator of the first switched-in Route. Do nothing by default.
void display_bank_start (uint32_t /*current_bank*/);
-
+
/// called from MackieControlProtocol::zero_all to turn things off
void zero_all ();
void zero_controls ();
@@ -122,7 +122,7 @@ public:
void recalibrate_faders ();
void toggle_backlight ();
void set_touch_sensitivity (int);
-
+
/**
This is used to calculate the clicks per second that define
a transport speed of 1.0 for the jog wheel. 100.0 is 10 clicks
@@ -144,7 +144,7 @@ public:
// be two characters
void show_two_char_display (const std::string & msg, const std::string & dots = " ");
void show_two_char_display (unsigned int value, const std::string & dots = " ");
-
+
void update_view_mode_display ();
void update_flip_mode_display ();
@@ -162,7 +162,7 @@ public:
int set_state (const XMLNode&, int version);
protected:
-
+
private:
MackieControlProtocol& _mcp;
SurfacePort* _port;
diff --git a/libs/surfaces/mackie/surface_port.cc b/libs/surfaces/mackie/surface_port.cc
index 4a8cff6e16..3129b5a1fd 100644
--- a/libs/surfaces/mackie/surface_port.cc
+++ b/libs/surfaces/mackie/surface_port.cc
@@ -57,7 +57,7 @@ SurfacePort::SurfacePort (Surface& s)
_output_port = _input_port;
} else {
-
+
_async_in = AudioEngine::instance()->register_input_port (DataType::MIDI, string_compose (_("%1 in"), _surface->name()), true);
_async_out = AudioEngine::instance()->register_output_port (DataType::MIDI, string_compose (_("%1 out"), _surface->name()), true);
@@ -81,7 +81,7 @@ SurfacePort::~SurfacePort()
AudioEngine::instance()->unregister_port (_async_in);
_async_in.reset ((ARDOUR::Port*) 0);
}
-
+
if (_async_out) {
_output_port->drain (10000);
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("unregistering output port %1\n", _async_out->name()));
@@ -106,7 +106,7 @@ SurfacePort::get_state ()
child = new XMLNode (X_("Input"));
child->add_child_nocopy (_async_in->get_state());
node->add_child_nocopy (*child);
-
+
child = new XMLNode (X_("Output"));
child->add_child_nocopy (_async_out->get_state());
@@ -150,7 +150,7 @@ string fetch_errmsg (int error_number)
char * msg = strerror (error_number);
return msg;
}
-
+
int
SurfacePort::write (const MidiByteArray & mba)
{
@@ -164,7 +164,7 @@ SurfacePort::write (const MidiByteArray & mba)
if (mba[0] != 0xf0 && mba.size() > 3) {
std::cerr << "TOO LONG WRITE: " << mba << std::endl;
}
-
+
/* this call relies on std::vector<T> using contiguous storage. not
* actually guaranteed by the standard, but way, way beyond likely.
*/
diff --git a/libs/surfaces/mackie/surface_port.h b/libs/surfaces/mackie/surface_port.h
index d22e46f4bf..2c78e692a7 100644
--- a/libs/surfaces/mackie/surface_port.h
+++ b/libs/surfaces/mackie/surface_port.h
@@ -58,7 +58,7 @@ public:
/// an easier way to output bytes via midi
int write (const MidiByteArray&);
-
+
MIDI::Port& input_port() const { return *_input_port; }
MIDI::Port& output_port() const { return *_output_port; }
@@ -73,7 +73,7 @@ private:
MIDI::Port* _output_port;
boost::shared_ptr<ARDOUR::Port> _async_in;
boost::shared_ptr<ARDOUR::Port> _async_out;
-};
+};
std::ostream& operator << (std::ostream& , const SurfacePort& port);
diff --git a/libs/surfaces/mackie/timer.h b/libs/surfaces/mackie/timer.h
index 31470a92c3..423b962ce8 100644
--- a/libs/surfaces/mackie/timer.h
+++ b/libs/surfaces/mackie/timer.h
@@ -36,7 +36,7 @@ namespace Mackie
class Timer
{
public:
-
+
/**
start the timer running if true, or just create the
object if false.
@@ -46,7 +46,7 @@ public:
if ( shouldStart )
start();
}
-
+
/**
Start the timer running. Return the current timestamp, in milliseconds
*/
@@ -81,7 +81,7 @@ public:
return (_stop - _start) / 1000;
}
}
-
+
/**
Call stop and then start. Return the value from stop.
*/
diff --git a/libs/surfaces/mackie/types.h b/libs/surfaces/mackie/types.h
index fd1b225c65..87676ae0f6 100644
--- a/libs/surfaces/mackie/types.h
+++ b/libs/surfaces/mackie/types.h
@@ -41,19 +41,19 @@ public:
LedState (state_t state): _state (state) {}
LedState& operator= (state_t s) { _state = s; return *this; }
-
+
bool operator == (const LedState & other) const
{
return state() == other.state();
}
-
+
bool operator != (const LedState & other) const
{
return state() != other.state();
}
-
+
state_t state() const { return _state; }
-
+
private:
state_t _state;
};
@@ -72,27 +72,27 @@ enum ButtonState { neither = -1, release = 0, press = 1 };
struct ControlState
{
ControlState(): pos(0.0), sign(0), delta(0.0), ticks(0), led_state(off), button_state(neither) {}
-
+
ControlState (LedState ls): pos(0.0), delta(0.0), led_state(ls), button_state(neither) {}
-
+
// Note that this sets both pos and delta to the flt value
ControlState (LedState ls, float flt): pos(flt), delta(flt), ticks(0), led_state(ls), button_state(neither) {}
ControlState (float flt): pos(flt), delta(flt), ticks(0), led_state(none), button_state(neither) {}
ControlState (float flt, unsigned int tcks): pos(flt), delta(flt), ticks(tcks), led_state(none), button_state(neither) {}
ControlState (ButtonState bs): pos(0.0), delta(0.0), ticks(0), led_state(none), button_state(bs) {}
-
+
/// For faders. Between 0 and 1.
float pos;
-
+
/// For pots. Sign. Either -1 or 1;
int sign;
/// For pots. Signed value of total movement. Between 0 and 1
float delta;
-
+
/// For pots. Unsigned number of ticks. Usually between 1 and 16.
unsigned int ticks;
-
+
LedState led_state;
ButtonState button_state;
};
diff --git a/libs/surfaces/osc/interface.cc b/libs/surfaces/osc/interface.cc
index 568e03edff..d26a31788e 100644
--- a/libs/surfaces/osc/interface.cc
+++ b/libs/surfaces/osc/interface.cc
@@ -28,7 +28,7 @@ static ControlProtocol*
new_osc_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
{
OSC* osc = new OSC (*s, Config->get_osc_port());
-
+
osc->set_active (true);
return osc;
diff --git a/libs/surfaces/osc/osc.h b/libs/surfaces/osc/osc.h
index f046053091..38aad2945f 100644
--- a/libs/surfaces/osc/osc.h
+++ b/libs/surfaces/osc/osc.h
@@ -44,7 +44,7 @@ namespace ARDOUR {
class Session;
class Route;
}
-
+
/* this is mostly a placeholder because I suspect that at some
point we will want to add more members to accomodate
certain types of requests to the OSC UI
@@ -85,7 +85,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
GSource* local_server;
GSource* remote_server;
-
+
bool osc_input_handler (Glib::IOCondition, lo_server);
private:
@@ -102,7 +102,7 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
void register_callbacks ();
void route_added (ARDOUR::RouteList&);
-
+
// Handlers for "Application Hook" signals
void session_loaded (ARDOUR::Session&);
void session_exported (std::string, std::string);
@@ -114,9 +114,9 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
void send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg);
void current_value_query (const char* path, size_t len, lo_arg **argv, int argc, lo_message msg);
-
+
int current_value (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
-
+
int catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data);
static int _catchall (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data);
@@ -131,10 +131,10 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
name (data); \
return 0; \
}
-
+
PATH_CALLBACK_MSG(routes_list);
PATH_CALLBACK_MSG(transport_frame);
-
+
#define PATH_CALLBACK(name) \
static int _ ## name (const char *path, const char *types, lo_arg **argv, int argc, void *data, void *user_data) { \
return static_cast<OSC*>(user_data)->cb_ ## name (path, types, argv, argc, data); \
@@ -238,18 +238,18 @@ class OSC : public ARDOUR::ControlProtocol, public AbstractUI<OSCUIRequest>
int route_set_send_gain_dB (int rid, int sid, float val);
int route_plugin_parameter (int rid, int piid,int par, float val);
int route_plugin_parameter_print (int rid, int piid,int par);
-
+
void listen_to_route (boost::shared_ptr<ARDOUR::Route>, lo_address);
void end_listen (boost::shared_ptr<ARDOUR::Route>, lo_address);
void drop_route (boost::weak_ptr<ARDOUR::Route>);
-
+
void route_name_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> r, lo_address addr);
-
+
void update_clock ();
typedef std::list<OSCRouteObserver*> RouteObservers;
-
+
RouteObservers route_observers;
static OSC* _instance;
diff --git a/libs/surfaces/osc/osc_controllable.cc b/libs/surfaces/osc/osc_controllable.cc
index ce86c8aee7..2cd4c31080 100644
--- a/libs/surfaces/osc/osc_controllable.cc
+++ b/libs/surfaces/osc/osc_controllable.cc
@@ -63,7 +63,7 @@ void
OSCControllable::send_change_message ()
{
lo_message msg = lo_message_new ();
-
+
lo_message_add_float (msg, (float) controllable->get_value());
/* XXX thread issues */
@@ -72,7 +72,7 @@ OSCControllable::send_change_message ()
lo_message_free (msg);
}
-/*------------------------------------------------------------*/
+/*------------------------------------------------------------*/
OSCRouteControllable::OSCRouteControllable (lo_address a, const std::string& p,
boost::shared_ptr<Controllable> c, boost::shared_ptr<Route> r)
diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc
index b7075e1d27..8bb511b94f 100644
--- a/libs/surfaces/osc/osc_route_observer.cc
+++ b/libs/surfaces/osc/osc_route_observer.cc
@@ -37,7 +37,7 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Route> r, lo_address a)
: _route (r)
{
addr = lo_address_new (lo_address_get_hostname(a) , lo_address_get_port(a));
-
+
_route->PropertyChanged.connect (name_changed_connection, MISSING_INVALIDATOR, boost::bind (&OSCRouteObserver::name_changed, this, boost::lambda::_1), OSC::instance());
if (boost::dynamic_pointer_cast<AudioTrack>(_route) || boost::dynamic_pointer_cast<MidiTrack>(_route)) {
@@ -47,7 +47,7 @@ OSCRouteObserver::OSCRouteObserver (boost::shared_ptr<Route> r, lo_address a)
rec_controllable->Changed.connect (rec_changed_connection, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/route/rec"), track->rec_enable_control()), OSC::instance());
}
-
+
boost::shared_ptr<Controllable> mute_controllable = boost::dynamic_pointer_cast<Controllable>(_route->mute_control());
mute_controllable->Changed.connect (mute_changed_connection, MISSING_INVALIDATOR, bind (&OSCRouteObserver::send_change_message, this, X_("/route/mute"), _route->mute_control()), OSC::instance());
@@ -75,11 +75,11 @@ OSCRouteObserver::name_changed (const PBD::PropertyChange& what_changed)
if (!what_changed.contains (ARDOUR::Properties::name)) {
return;
}
-
+
if (!_route) {
return;
}
-
+
lo_message msg = lo_message_new ();
lo_message_add_int32 (msg, _route->remote_control_id());
diff --git a/libs/surfaces/osc/osc_route_observer.h b/libs/surfaces/osc/osc_route_observer.h
index b83b0f1e64..7153da7329 100644
--- a/libs/surfaces/osc/osc_route_observer.h
+++ b/libs/surfaces/osc/osc_route_observer.h
@@ -42,13 +42,13 @@ class OSCRouteObserver
private:
boost::shared_ptr<ARDOUR::Route> _route;
//boost::shared_ptr<Controllable> _controllable;
-
+
PBD::ScopedConnection name_changed_connection;
PBD::ScopedConnection rec_changed_connection;
PBD::ScopedConnection mute_changed_connection;
PBD::ScopedConnection solo_changed_connection;
PBD::ScopedConnection gain_changed_connection;
-
+
lo_address addr;
std::string path;
diff --git a/libs/surfaces/tranzport/bling.cc b/libs/surfaces/tranzport/bling.cc
index ea2ef56d42..308430af68 100644
--- a/libs/surfaces/tranzport/bling.cc
+++ b/libs/surfaces/tranzport/bling.cc
@@ -109,7 +109,7 @@ bling::scrollmsg() {
// Based on the current bling mode, do whatever it is you are going to do
bling::run() {
-
+
}
// etc
diff --git a/libs/surfaces/tranzport/buttons.cc b/libs/surfaces/tranzport/buttons.cc
index 99bcccc902..a35f025489 100644
--- a/libs/surfaces/tranzport/buttons.cc
+++ b/libs/surfaces/tranzport/buttons.cc
@@ -55,7 +55,7 @@ TranzportControlProtocol::process (uint8_t* buf)
this_button_mask |= buf[4] << 8;
this_button_mask |= buf[5];
_datawheel = buf[6];
-
+
#if DEBUG_TRANZPORT_STATE > 1
// Is the state machine incomplete?
const unsigned int knownstates = 0x00004000|0x00008000|
diff --git a/libs/surfaces/tranzport/general.cc b/libs/surfaces/tranzport/general.cc
index d051b36d1d..35d2f2bb3b 100644
--- a/libs/surfaces/tranzport/general.cc
+++ b/libs/surfaces/tranzport/general.cc
@@ -76,7 +76,7 @@ int TranzportControlProtocol::lights_show_bling()
case BlingPairs: break; // Show pairs of lights
case BlingRows: break; // light each row in sequence
case BlingFlashAll: break; // Flash everything randomly
- case BlingEnter: lights_on(); // Show intro
+ case BlingEnter: lights_on(); // Show intro
case BlingExit:
lights_off();
break;
@@ -93,7 +93,7 @@ int TranzportControlProtocol::screen_show_bling()
case BlingPairs: break; // Show pairs of lights
case BlingRows: break; // light each row in sequence
case BlingFlashAll: break; // Flash everything randomly
- case BlingEnter: // Show intro
+ case BlingEnter: // Show intro
print(0,0,"!!Welcome to Ardour!");
print(1,0,"Peace through Music!");
break;
@@ -182,7 +182,7 @@ void
TranzportControlProtocol::prev_marker ()
{
Location *location = session->locations()->first_location_before (session->transport_frame());
-
+
if (location) {
session->request_locate (location->start(), session->transport_rolling());
notify(location->name().c_str());
@@ -242,7 +242,7 @@ TranzportControlProtocol::step_gain (float increment)
if (fabsf(gain_fraction) > 2.0) {
gain_fraction = 2.0*sign(gain_fraction);
}
-
+
route_set_gain (0, slider_position_to_gain (gain_fraction));
}
#endif
@@ -259,7 +259,7 @@ TranzportControlProtocol::step_gain_up ()
if (gain_fraction > 2.0) {
gain_fraction = 2.0;
}
-
+
route_set_gain (0, slider_position_to_gain (gain_fraction));
}
@@ -275,7 +275,7 @@ TranzportControlProtocol::step_gain_down ()
if (gain_fraction < 0.0) {
gain_fraction = 0.0;
}
-
+
route_set_gain (0, slider_position_to_gain (gain_fraction));
}
diff --git a/libs/surfaces/tranzport/init.cc b/libs/surfaces/tranzport/init.cc
index 3a01185407..459da81cbc 100644
--- a/libs/surfaces/tranzport/init.cc
+++ b/libs/surfaces/tranzport/init.cc
@@ -65,7 +65,7 @@ int TranzportControlProtocol::rtpriority_unset(int priority)
struct sched_param rtparam;
int err;
memset (&rtparam, 0, sizeof (rtparam));
- rtparam.sched_priority = priority;
+ rtparam.sched_priority = priority;
if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) {
PBD::info << string_compose (_("%1: can't stop realtime scheduling (%2)"), name(), strerror (errno)) << endmsg;
return 1;
@@ -208,7 +208,7 @@ TranzportControlProtocol::monitor_work ()
case 3: val = read(buf,DEFAULT_USB_TIMEOUT*2); break; // Hoo, boy, we're in trouble
default: break; // not reached
}
-
+
#if DEBUG_TRANZPORT_BITS > 9
if(_device_status != STATUS_OFFLINE && _device_status != STATUS_ONLINE && _device_status != STATUS_OK) {
printf("The device has more status bits than off or online: %d\n",_device_status);
@@ -265,7 +265,7 @@ TranzportControlProtocol::monitor_work ()
printf("OFFLINE : %02x %02x %02x %02x %02x %02x %02x %02x\n",
buf[0],buf[1],buf[2], buf[3], buf[4], buf[5],buf[6],buf[7]);
}
-
+
if(_device_status == STATUS_OK) {
printf("OK : %02x %02x %02x %02x %02x %02x %02x %02x\n",
buf[0],buf[1],buf[2], buf[3], buf[4], buf[5],buf[6],buf[7]);
diff --git a/libs/surfaces/tranzport/interface.cc b/libs/surfaces/tranzport/interface.cc
index ac4341cde8..514cfbe4fb 100644
--- a/libs/surfaces/tranzport/interface.cc
+++ b/libs/surfaces/tranzport/interface.cc
@@ -34,7 +34,7 @@ new_tranzport_protocol (ControlProtocolDescriptor* descriptor, Session* s)
}
return tcp;
-
+
}
static void
@@ -60,7 +60,7 @@ static ControlProtocolDescriptor tranzport_descriptor = {
initialize : new_tranzport_protocol,
destroy : delete_tranzport_protocol
};
-
+
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &tranzport_descriptor; }
diff --git a/libs/surfaces/tranzport/io.cc b/libs/surfaces/tranzport/io.cc
index 39be2c2e51..3fe1b554ca 100644
--- a/libs/surfaces/tranzport/io.cc
+++ b/libs/surfaces/tranzport/io.cc
@@ -67,10 +67,10 @@ TranzportControlProtocol::lights_flush ()
printf("LPEND : %s\n", lights_pending.to_string().c_str());
printf("LCURR : %s\n", lights_current.to_string().c_str());
#endif
-
+
// if ever we thread reads/writes STATUS_OK will have to move into the loop
int i;
-
+
if ( _device_status == STATUS_OK || _device_status == STATUS_ONLINE) {
for (i = 0; i<LIGHTS; i++) {
if(light_state[i]) {
@@ -90,6 +90,6 @@ TranzportControlProtocol::lights_flush ()
#if DEBUG_TRANZPORT_LIGHTS > 2
printf("Did %d light writes, left: %d\n",i, light_state.count());
#endif
-
+
return light_state.count();
}
diff --git a/libs/surfaces/tranzport/io_kernel.cc b/libs/surfaces/tranzport/io_kernel.cc
index 0532ee7e6b..6c2bc37922 100644
--- a/libs/surfaces/tranzport/io_kernel.cc
+++ b/libs/surfaces/tranzport/io_kernel.cc
@@ -92,7 +92,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override)
return last_read_error;
}
-
+
int
TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override)
{
@@ -131,13 +131,13 @@ TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override
return 0;
-}
+}
int
TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
{
return (write_noretry(cmd,timeout_override));
-}
+}
// FIXME - install poll semantics
#endif /* HAVE_TRANZPORT_KERNEL_DRIVER */
diff --git a/libs/surfaces/tranzport/io_usb.cc b/libs/surfaces/tranzport/io_usb.cc
index 5d4e75f7d1..56d270b62a 100644
--- a/libs/surfaces/tranzport/io_usb.cc
+++ b/libs/surfaces/tranzport/io_usb.cc
@@ -97,7 +97,7 @@ TranzportControlProtocol::open_core (struct usb_device* dev)
cerr << _("Tranzport: cannot open USB transport") << endmsg;
return -1;
}
-
+
if (usb_claim_interface (udev, 0) < 0) {
cerr << _("Tranzport: cannot claim USB interface") << endmsg;
usb_close (udev);
@@ -158,7 +158,7 @@ int TranzportControlProtocol::read(uint8_t *buf, uint32_t timeout_override)
return last_read_error;
}
-
+
int
TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override)
{
@@ -195,7 +195,7 @@ TranzportControlProtocol::write_noretry (uint8_t* cmd, uint32_t timeout_override
return 0;
-}
+}
int
TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
@@ -204,7 +204,7 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
int val;
int retry = 0;
if(inflight > MAX_TRANZPORT_INFLIGHT) { return (-1); }
-
+
while((val = usb_interrupt_write (udev, WRITE_ENDPOINT, (char*) cmd, 8, timeout_override ? timeout_override : timeout))!=8 && retry++ < MAX_RETRY) {
printf("usb_interrupt_write failed, retrying: %d\n", val);
}
@@ -227,6 +227,6 @@ TranzportControlProtocol::write (uint8_t* cmd, uint32_t timeout_override)
return (write_noretry(cmd,timeout_override));
#endif
-}
+}
#endif
diff --git a/libs/surfaces/tranzport/lcd.cc b/libs/surfaces/tranzport/lcd.cc
index 592bf7cf00..7e9e03c8f2 100644
--- a/libs/surfaces/tranzport/lcd.cc
+++ b/libs/surfaces/tranzport/lcd.cc
@@ -44,7 +44,7 @@ bool TranzportControlProtocol::lcd_damage (int row, int col, int length)
bool TranzportControlProtocol::lcd_isdamaged ()
{
if(screen_invalid.any()) {
-#if DEBUG_TRANZPORT > 5
+#if DEBUG_TRANZPORT > 5
printf("LCD is damaged somewhere, should redraw it\n");
#endif
return true;
@@ -60,7 +60,7 @@ bool TranzportControlProtocol::lcd_isdamaged (int row, int col, int length)
std::bitset<ROWS*COLUMNS> mask(mask1 << (row*COLUMNS+col));
mask &= screen_invalid;
if(mask.any()) {
-#if DEBUG_TRANZPORT > 5
+#if DEBUG_TRANZPORT > 5
printf("row: %d,col: %d is damaged, should redraw it\n", row,col);
#endif
return true;
diff --git a/libs/surfaces/tranzport/show.cc b/libs/surfaces/tranzport/show.cc
index 6d97abf43a..544bb3df96 100644
--- a/libs/surfaces/tranzport/show.cc
+++ b/libs/surfaces/tranzport/show.cc
@@ -169,7 +169,7 @@ void TranzportControlProtocol::show_mini_meter()
}
last_meter_fill_l = fill_left; last_meter_fill_r = fill_right;
-
+
// give some feedback when overdriving - override yellow and red lights
if (fraction_l > 0.96 || fraction_r > 0.96) {
@@ -179,7 +179,7 @@ void TranzportControlProtocol::show_mini_meter()
if (fraction_l == 1.0 || fraction_r == 1.0) {
light_on (LightTrackrec);
}
-
+
const uint8_t char_map[16] = { ' ', TRANZ_UL,
TRANZ_U, TRANZ_U,
TRANZ_BL, TRANZ_Q2,
@@ -196,7 +196,7 @@ void TranzportControlProtocol::show_mini_meter()
((fill_right >=j) << 2) | ((fill_right >= j+1) << 3);
buf[i] = char_map[val];
}
-
+
/* print() requires this */
buf[meter_size/2] = '\0';
@@ -204,11 +204,11 @@ void TranzportControlProtocol::show_mini_meter()
print (1, 0, buf);
/* Add a peak bar, someday do falloff */
-
+
// char peak[2]; peak[0] = ' '; peak[1] = '\0';
// if(fraction_l == 1.0 || fraction_r == 1.0) peak[0] = 'P';
// print (1,8,peak); // Put a peak meter - P in if we peaked.
-
+
}
void
@@ -261,7 +261,7 @@ TranzportControlProtocol::show_meter ()
for (i = 0; i < fill; ++i) {
buf[i] = 0x07; /* tranzport special code for 4 quadrant LCD block */
}
-
+
/* add a possible half-step */
if (i < 20 && add_single_level) {
@@ -349,7 +349,7 @@ void
TranzportControlProtocol::show_transport_time ()
{
show_bbt (session->transport_frame ());
-}
+}
void
TranzportControlProtocol::show_timecode (framepos_t where)
diff --git a/libs/surfaces/tranzport/state.cc b/libs/surfaces/tranzport/state.cc
index f5718174be..59eaef0460 100644
--- a/libs/surfaces/tranzport/state.cc
+++ b/libs/surfaces/tranzport/state.cc
@@ -60,7 +60,7 @@ TranzportControlProtocol::set_state (const XMLNode& node)
int retval = 0;
// I think I want to make these strings rather than numbers
-#if 0
+#if 0
// fetch current display mode
if ( node.property( X_("display_mode") ) != 0 )
{
diff --git a/libs/surfaces/tranzport/tranzport_control_protocol.h b/libs/surfaces/tranzport/tranzport_control_protocol.h
index aa60d5399f..32d88aaf5e 100644
--- a/libs/surfaces/tranzport/tranzport_control_protocol.h
+++ b/libs/surfaces/tranzport/tranzport_control_protocol.h
@@ -106,7 +106,7 @@ private:
WheelShiftMaster,
WheelShiftMarker
};
-
+
enum WheelMode {
WheelTimeline,
WheelScrub,
@@ -124,7 +124,7 @@ private:
WheelIncrSecond,
WheelIncrMinute
};
-
+
enum DisplayMode {
DisplayNormal,
DisplayRecording,
@@ -301,7 +301,7 @@ private:
void show_current_track ();
void show_track_gain ();
void show_transport_time ();
- void show_bbt (framepos_t where);
+ void show_bbt (framepos_t where);
void show_timecode (framepos_t where);
void show_wheel_mode ();
void show_gain ();
diff --git a/libs/surfaces/tranzport/wheel.cc b/libs/surfaces/tranzport/wheel.cc
index 8122b8a77d..d90e0e2b6e 100644
--- a/libs/surfaces/tranzport/wheel.cc
+++ b/libs/surfaces/tranzport/wheel.cc
@@ -55,7 +55,7 @@ TranzportControlProtocol::datawheel ()
if ((buttonmask & ButtonTrackRight) || (buttonmask & ButtonTrackLeft)) {
/* track scrolling */
-
+
if (_datawheel < WheelDirectionThreshold) {
next_track ();
} else {
@@ -63,7 +63,7 @@ TranzportControlProtocol::datawheel ()
}
last_wheel_motion = 0;
-
+
} else if ((buttonmask & ButtonPrev) || (buttonmask & ButtonNext)) {
if (_datawheel < WheelDirectionThreshold) {
@@ -71,13 +71,13 @@ TranzportControlProtocol::datawheel ()
} else {
prev_marker ();
}
-
+
last_wheel_motion = 0;
-
+
} else if (buttonmask & ButtonShift) {
-
+
/* parameter control */
-
+
if (route_table[0]) {
switch (wheel_shift_mode) {
case WheelShiftGain:
@@ -94,29 +94,29 @@ TranzportControlProtocol::datawheel ()
step_pan_left ();
}
break;
-
+
case WheelShiftMarker:
break;
-
+
case WheelShiftMaster:
break;
-
+
}
}
-
+
last_wheel_motion = 0;
-
+
} else {
-
+
switch (wheel_mode) {
case WheelTimeline:
scroll ();
break;
-
+
case WheelScrub:
scrub ();
break;
-
+
case WheelShuttle:
shuttle ();
break;
@@ -151,35 +151,35 @@ TranzportControlProtocol::scrub ()
float speed;
uint64_t now;
int dir;
-
+
now = g_get_monotonic_time();
-
+
if (_datawheel < WheelDirectionThreshold) {
dir = 1;
} else {
dir = -1;
}
-
+
if (dir != last_wheel_dir) {
/* changed direction, start over */
speed = 0.1f;
} else {
if (last_wheel_motion != 0) {
/* 10 clicks per second => speed == 1.0 */
-
+
speed = 100000.0f / (float) (now - last_wheel_motion)
-
+
} else {
-
+
/* start at half-speed and see where we go from there */
-
+
speed = 0.5f;
}
}
-
+
last_wheel_motion = now;
last_wheel_dir = dir;
-
+
set_transport_speed (speed * dir);
}
diff --git a/libs/surfaces/tranzport/wheel_modes.cc b/libs/surfaces/tranzport/wheel_modes.cc
index 565a68de20..6880218ff0 100644
--- a/libs/surfaces/tranzport/wheel_modes.cc
+++ b/libs/surfaces/tranzport/wheel_modes.cc
@@ -102,7 +102,7 @@ TranzportControlProtocol::show_wheel_mode ()
if(session->transport_speed() != 0) {
show_mini_meter();
} else {
-
+
switch (wheel_mode) {
case WheelTimeline:
text = "Time";
@@ -114,25 +114,25 @@ TranzportControlProtocol::show_wheel_mode ()
text = "Shtl";
break;
}
-
+
switch (wheel_shift_mode) {
case WheelShiftGain:
text += ":Gain";
break;
-
+
case WheelShiftPan:
text += ":Pan ";
break;
-
+
case WheelShiftMaster:
text += ":Mstr";
break;
-
+
case WheelShiftMarker:
text += ":Mrkr";
break;
}
-
+
print (1, 0, text.c_str());
}
}
diff --git a/libs/timecode/src/time.cc b/libs/timecode/src/time.cc
index 421accfdd1..494e6e1145 100644
--- a/libs/timecode/src/time.cc
+++ b/libs/timecode/src/time.cc
@@ -1,6 +1,6 @@
/*
Copyright (C) 2006-2010 Paul Davis
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
@@ -161,7 +161,7 @@ decrement (Time& timecode, uint32_t subframes_per_frame)
timecode.frames = 29;
wrap = SECONDS;
}
-
+
} else {
if (timecode.frames == 0) {
timecode.frames = 29;
diff --git a/libs/timecode/timecode/bbt_time.h b/libs/timecode/timecode/bbt_time.h
index 31e62f23bf..8b92f6efa9 100644
--- a/libs/timecode/timecode/bbt_time.h
+++ b/libs/timecode/timecode/bbt_time.h
@@ -34,15 +34,15 @@ struct LIBTIMECODE_API BBT_Time {
uint32_t bars;
uint32_t beats;
uint32_t ticks;
-
+
BBT_Time ()
: bars (1), beats (1), ticks (0) {}
-
+
BBT_Time (uint32_t ba, uint32_t be, uint32_t t)
: bars (ba), beats (be), ticks (t) {}
BBT_Time (double beats);
-
+
bool operator< (const BBT_Time& other) const {
return bars < other.bars ||
(bars == other.bars && beats < other.beats) ||
@@ -66,7 +66,7 @@ struct LIBTIMECODE_API BBT_Time {
(bars >= other.bars && beats >= other.beats) ||
(bars >= other.bars && beats >= other.beats && ticks >= other.ticks);
}
-
+
bool operator== (const BBT_Time& other) const {
return bars == other.bars && beats == other.beats && ticks == other.ticks;
}
@@ -75,7 +75,7 @@ struct LIBTIMECODE_API BBT_Time {
return bars != other.bars || beats != other.beats || ticks != other.ticks;
}
};
-
+
}
inline std::ostream&
diff --git a/libs/timecode/timecode/time.h b/libs/timecode/timecode/time.h
index 5ee763d33e..100b5d30d8 100644
--- a/libs/timecode/timecode/time.h
+++ b/libs/timecode/timecode/time.h
@@ -1,16 +1,16 @@
/*
Copyright (C) 2006-2010 Paul Davis
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser 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; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -71,7 +71,7 @@ struct LIBTIMECODE_API Time {
rate = a_rate;
drop = (lrintf(100.f * (float)a_rate) == (long)2997);
}
-
+
bool operator== (const Time& other) const {
return negative == other.negative && hours == other.hours &&
minutes == other.minutes && seconds == other.seconds &&
diff --git a/libs/vamp-plugins/AmplitudeFollower.cpp b/libs/vamp-plugins/AmplitudeFollower.cpp
index c4b2e56b62..3b87442552 100644
--- a/libs/vamp-plugins/AmplitudeFollower.cpp
+++ b/libs/vamp-plugins/AmplitudeFollower.cpp
@@ -108,7 +108,7 @@ AmplitudeFollower::initialise(size_t channels, size_t stepSize, size_t blockSize
channels > getMaxChannelCount()) return false;
m_stepSize = std::min(stepSize, blockSize);
-
+
// Translate the coefficients
// from their "convenient" 60dB convergence-time values
// to real coefficients
@@ -148,7 +148,7 @@ AmplitudeFollower::ParameterList
AmplitudeFollower::getParameterDescriptors() const
{
ParameterList list;
-
+
ParameterDescriptor att;
att.identifier = "attack";
att.name = "Attack time";
@@ -210,14 +210,14 @@ AmplitudeFollower::process(const float *const *inputBuffers,
float previn = m_previn;
FeatureSet returnFeatures;
-
+
float val;
float peak = 0.0f;
for (size_t i = 0; i < m_stepSize; ++i) {
val = fabs(inputBuffers[0][i]);
-
+
if (val < previn) {
val = val + (previn - val) * m_relaxcoef;
} else {
diff --git a/libs/vamp-plugins/AmplitudeFollower.h b/libs/vamp-plugins/AmplitudeFollower.h
index dc69b67bf8..ef7edcff69 100644
--- a/libs/vamp-plugins/AmplitudeFollower.h
+++ b/libs/vamp-plugins/AmplitudeFollower.h
@@ -61,9 +61,9 @@ public:
std::string getMaker() const;
int getPluginVersion() const;
std::string getCopyright() const;
-
+
OutputList getOutputDescriptors() const;
-
+
ParameterList getParameterDescriptors() const;
float getParameter(std::string paramid) const;
void setParameter(std::string paramid, float newval);