From 22b07e0233a29d9633ffa825a79503befaf2e16e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 5 Oct 2015 16:17:49 +0200 Subject: [PATCH] NOOP, remove trailing tabs/whitespace. --- gtk2_ardour/add_route_dialog.cc | 4 +- gtk2_ardour/add_route_dialog.h | 2 +- gtk2_ardour/ardour_button.cc | 2 +- gtk2_ardour/ardour_button.h | 2 +- gtk2_ardour/ardour_display.cc | 6 +- gtk2_ardour/ardour_dropdown.cc | 2 +- gtk2_ardour/ardour_knob.cc | 46 +- gtk2_ardour/ardour_knob.h | 2 +- gtk2_ardour/ardour_ui.cc | 4 +- gtk2_ardour/ardour_ui.h | 12 +- gtk2_ardour/ardour_ui2.cc | 4 +- gtk2_ardour/ardour_ui_dialogs.cc | 4 +- gtk2_ardour/ardour_ui_ed.cc | 2 +- gtk2_ardour/ardour_window.cc | 2 +- gtk2_ardour/audio_clock.cc | 16 +- gtk2_ardour/audio_clock.h | 4 +- gtk2_ardour/audio_region_view.cc | 42 +- gtk2_ardour/audio_region_view.h | 2 +- gtk2_ardour/audio_streamview.cc | 2 +- gtk2_ardour/audio_time_axis.cc | 6 +- gtk2_ardour/automation_line.cc | 36 +- gtk2_ardour/automation_line.h | 2 +- gtk2_ardour/automation_time_axis.cc | 18 +- gtk2_ardour/axis_view.h | 6 +- gtk2_ardour/big_clock_window.h | 4 +- gtk2_ardour/bundle_env_cocoa.cc | 4 +- gtk2_ardour/bundle_env_msvc.cc | 10 +- gtk2_ardour/button_joiner.cc | 22 +- gtk2_ardour/button_joiner.h | 2 +- gtk2_ardour/canvas-waveview.c | 4 +- gtk2_ardour/control_point.cc | 2 +- gtk2_ardour/control_point.h | 2 +- gtk2_ardour/edit_note_dialog.cc | 6 +- gtk2_ardour/editor.cc | 88 +-- gtk2_ardour/editor.h | 12 +- gtk2_ardour/editor_actions.cc | 22 +- gtk2_ardour/editor_canvas.cc | 62 +- gtk2_ardour/editor_canvas_events.cc | 32 +- gtk2_ardour/editor_cursors.cc | 4 +- gtk2_ardour/editor_cursors.h | 2 +- gtk2_ardour/editor_drag.cc | 2 +- gtk2_ardour/editor_drag.h | 12 +- gtk2_ardour/editor_export_audio.cc | 14 +- gtk2_ardour/editor_group_tabs.cc | 2 +- gtk2_ardour/editor_keys.cc | 12 +- gtk2_ardour/editor_markers.cc | 16 +- gtk2_ardour/editor_mixer.cc | 4 +- gtk2_ardour/editor_mouse.cc | 28 +- gtk2_ardour/editor_ops.cc | 248 ++++---- gtk2_ardour/editor_regions.cc | 6 +- gtk2_ardour/editor_route_groups.cc | 16 +- gtk2_ardour/editor_routes.cc | 12 +- gtk2_ardour/editor_rulers.cc | 10 +- gtk2_ardour/editor_selection.cc | 16 +- gtk2_ardour/editor_summary.cc | 20 +- gtk2_ardour/editor_tempodisplay.cc | 4 +- gtk2_ardour/editor_timefx.cc | 2 +- gtk2_ardour/engine_dialog.cc | 8 +- gtk2_ardour/export_dialog.cc | 4 +- gtk2_ardour/export_file_notebook.cc | 2 +- gtk2_ardour/export_filename_selector.cc | 4 +- gtk2_ardour/export_format_dialog.h | 2 +- gtk2_ardour/export_timespan_selector.cc | 2 +- gtk2_ardour/floating_text_entry.cc | 2 +- gtk2_ardour/gain_meter.cc | 6 +- gtk2_ardour/generic_pluginui.cc | 32 +- gtk2_ardour/ghostregion.h | 2 +- gtk2_ardour/group_tabs.cc | 36 +- gtk2_ardour/group_tabs.h | 2 +- gtk2_ardour/gui_object.cc | 2 +- gtk2_ardour/gui_object.h | 2 +- gtk2_ardour/io_selector.cc | 2 +- gtk2_ardour/keyeditor.cc | 4 +- gtk2_ardour/linux_vst_gui_support.cc | 264 ++++----- gtk2_ardour/location_ui.cc | 6 +- gtk2_ardour/lxvst_plugin_ui.cc | 38 +- gtk2_ardour/lxvst_plugin_ui.h | 2 +- gtk2_ardour/main.cc | 2 +- gtk2_ardour/main_clock.h | 2 +- gtk2_ardour/marker.cc | 12 +- gtk2_ardour/meter_strip.h | 2 +- gtk2_ardour/midi_channel_selector.cc | 34 +- gtk2_ardour/midi_export_dialog.cc | 2 +- gtk2_ardour/midi_list_editor.cc | 54 +- gtk2_ardour/midi_region_view.cc | 56 +- gtk2_ardour/midi_region_view.h | 8 +- gtk2_ardour/midi_streamview.cc | 6 +- gtk2_ardour/midi_time_axis.cc | 20 +- gtk2_ardour/midi_tracer.cc | 4 +- gtk2_ardour/midi_tracer.h | 2 +- gtk2_ardour/midi_velocity_dialog.cc | 2 +- gtk2_ardour/mixer_actor.cc | 2 +- gtk2_ardour/mixer_group_tabs.cc | 6 +- gtk2_ardour/mixer_strip.cc | 58 +- gtk2_ardour/mixer_ui.cc | 110 ++-- gtk2_ardour/monitor_selector.cc | 2 +- gtk2_ardour/mono_panner.cc | 2 +- gtk2_ardour/mono_panner.h | 2 +- gtk2_ardour/mono_panner_editor.cc | 8 +- gtk2_ardour/mono_panner_editor.h | 2 +- gtk2_ardour/mouse_cursors.cc | 2 +- gtk2_ardour/mouse_cursors.h | 2 +- gtk2_ardour/msvc/winmain.cc | 2 +- gtk2_ardour/option_editor.cc | 10 +- gtk2_ardour/option_editor.h | 8 +- gtk2_ardour/panner_interface.h | 4 +- gtk2_ardour/patch_change.cc | 16 +- gtk2_ardour/patch_change_dialog.cc | 12 +- gtk2_ardour/piano_roll_header.cc | 12 +- gtk2_ardour/pingback.cc | 4 +- gtk2_ardour/playlist_selector.cc | 2 +- gtk2_ardour/plugin_eq_gui.cc | 2 +- gtk2_ardour/plugin_selector.cc | 4 +- gtk2_ardour/plugin_ui.cc | 6 +- gtk2_ardour/plugin_ui.h | 2 +- gtk2_ardour/port_matrix.cc | 20 +- gtk2_ardour/port_matrix_column_labels.cc | 4 +- gtk2_ardour/port_matrix_grid.cc | 4 +- gtk2_ardour/port_matrix_row_labels.cc | 4 +- gtk2_ardour/processor_box.cc | 52 +- gtk2_ardour/processor_box.h | 6 +- gtk2_ardour/public_editor.h | 4 +- gtk2_ardour/rc_option_editor.cc | 24 +- gtk2_ardour/rc_option_editor.h | 2 +- gtk2_ardour/region_layering_order_editor.cc | 10 +- gtk2_ardour/region_view.cc | 8 +- gtk2_ardour/route_group_dialog.cc | 8 +- gtk2_ardour/route_processor_selection.cc | 4 +- gtk2_ardour/route_sorter.h | 2 +- gtk2_ardour/route_time_axis.cc | 62 +- gtk2_ardour/route_ui.cc | 64 +-- gtk2_ardour/route_ui.h | 2 +- gtk2_ardour/save_as_dialog.cc | 10 +- gtk2_ardour/save_as_dialog.h | 4 +- gtk2_ardour/session_dialog.cc | 60 +- gtk2_ardour/session_option_editor.cc | 2 +- gtk2_ardour/sfdb_freesound_mootcher.cc | 24 +- gtk2_ardour/sfdb_ui.cc | 76 +-- gtk2_ardour/sfdb_ui.h | 4 +- gtk2_ardour/shuttle_control.cc | 4 +- gtk2_ardour/soundcloud_export_selector.h | 2 +- gtk2_ardour/splash.cc | 8 +- gtk2_ardour/startup.cc | 14 +- gtk2_ardour/stereo_panner.cc | 22 +- gtk2_ardour/stereo_panner.h | 2 +- gtk2_ardour/stereo_panner_editor.cc | 10 +- gtk2_ardour/stereo_panner_editor.h | 2 +- gtk2_ardour/streamview.cc | 10 +- gtk2_ardour/streamview.h | 2 +- gtk2_ardour/sys_ex.cc | 2 +- gtk2_ardour/sys_ex.h | 2 +- gtk2_ardour/tempo_dialog.cc | 8 +- gtk2_ardour/theme_manager.cc | 60 +- gtk2_ardour/theme_manager.h | 22 +- gtk2_ardour/time_axis_view.cc | 54 +- gtk2_ardour/time_axis_view_item.cc | 32 +- gtk2_ardour/time_fx_dialog.cc | 2 +- gtk2_ardour/time_fx_dialog.h | 2 +- gtk2_ardour/time_info_box.cc | 12 +- gtk2_ardour/ui_config.cc | 34 +- gtk2_ardour/ui_config.h | 8 +- gtk2_ardour/utils.cc | 14 +- gtk2_ardour/verbose_cursor.h | 2 +- gtk2_ardour/visibility_group.cc | 10 +- gtk2_ardour/visibility_group.h | 6 +- gtk2_ardour/volume_controller.cc | 4 +- gtk2_ardour/vst_plugin_ui.cc | 2 +- gtk2_ardour/vst_plugin_ui.h | 4 +- gtk2_ardour/window_manager.cc | 10 +- gtk2_ardour/window_manager.h | 16 +- gtk2_ardour/windows_vst_plugin_ui.cc | 8 +- gtk2_ardour/windows_vst_plugin_ui.h | 4 +- headless/load_session.cc | 4 +- headless/misc.cc | 8 +- libs/appleutility/AUOutputBL.cpp | 18 +- libs/appleutility/AUOutputBL.h | 18 +- libs/appleutility/AUParamInfo.cpp | 18 +- libs/appleutility/AUParamInfo.h | 24 +- libs/appleutility/CAAUParameter.cpp | 28 +- libs/appleutility/CAAUParameter.h | 36 +- libs/appleutility/CAAudioChannelLayout.cpp | 6 +- libs/appleutility/CAAudioChannelLayout.h | 30 +- .../CAAudioChannelLayoutObject.cpp | 18 +- libs/appleutility/CAAudioFile.cpp | 102 ++-- libs/appleutility/CAAudioFile.h | 68 +-- libs/appleutility/CAAudioUnit.cpp | 132 ++--- libs/appleutility/CAAudioUnit.h | 82 +-- libs/appleutility/CABufferList.cpp | 10 +- libs/appleutility/CABufferList.h | 48 +- libs/appleutility/CACFDictionary.cpp | 112 ++-- libs/appleutility/CACFDictionary.h | 22 +- libs/appleutility/CACFNumber.cpp | 4 +- libs/appleutility/CACFNumber.h | 2 +- libs/appleutility/CACFString.cpp | 4 +- libs/appleutility/CACFString.h | 6 +- libs/appleutility/CAComponent.cpp | 24 +- libs/appleutility/CAComponent.h | 32 +- libs/appleutility/CAComponentDescription.cpp | 12 +- libs/appleutility/CAComponentDescription.h | 34 +- libs/appleutility/CADebugMacros.h | 10 +- libs/appleutility/CAMath.h | 2 +- libs/appleutility/CAReferenceCounted.h | 6 +- .../appleutility/CAStreamBasicDescription.cpp | 70 +-- libs/appleutility/CAStreamBasicDescription.h | 36 +- libs/appleutility/CAXException.cpp | 2 +- libs/appleutility/CAXException.h | 18 +- libs/ardour/ardour/ardour.h | 2 +- libs/ardour/ardour/async_midi_port.h | 4 +- libs/ardour/ardour/audio_buffer.h | 2 +- libs/ardour/ardour/audio_track.h | 2 +- libs/ardour/ardour/audio_unit.h | 2 +- libs/ardour/ardour/audioengine.h | 8 +- libs/ardour/ardour/audioregion.h | 4 +- libs/ardour/ardour/automation_list.h | 4 +- libs/ardour/ardour/control_protocol_manager.h | 4 +- libs/ardour/ardour/delivery.h | 2 +- libs/ardour/ardour/engine_state_controller.h | 2 +- .../ardour/export_format_specification.h | 12 +- libs/ardour/ardour/file_source.h | 4 +- libs/ardour/ardour/graph.h | 2 +- libs/ardour/ardour/graphnode.h | 2 +- libs/ardour/ardour/midi_diskstream.h | 2 +- libs/ardour/ardour/midi_port.h | 4 +- libs/ardour/ardour/midi_scene_change.h | 2 +- libs/ardour/ardour/midi_track.h | 2 +- libs/ardour/ardour/midiport_manager.h | 2 +- libs/ardour/ardour/panner.h | 2 +- libs/ardour/ardour/playlist.h | 2 +- libs/ardour/ardour/plugin.h | 4 +- libs/ardour/ardour/plugin_insert.h | 2 +- libs/ardour/ardour/plugin_manager.h | 2 +- libs/ardour/ardour/port_manager.h | 10 +- libs/ardour/ardour/region.h | 10 +- libs/ardour/ardour/region_factory.h | 2 +- libs/ardour/ardour/revision.h | 2 +- libs/ardour/ardour/route.h | 8 +- libs/ardour/ardour/route_graph.h | 8 +- libs/ardour/ardour/scene_change.h | 2 +- libs/ardour/ardour/scene_changer.h | 4 +- libs/ardour/ardour/send.h | 2 +- libs/ardour/ardour/session.h | 36 +- libs/ardour/ardour/session_event.h | 2 +- libs/ardour/ardour/session_route.h | 6 +- libs/ardour/ardour/slave.h | 8 +- libs/ardour/ardour/smf_source.h | 2 +- libs/ardour/ardour/tempo.h | 20 +- libs/ardour/ardour/track.h | 6 +- libs/ardour/ardour/utils.h | 6 +- libs/ardour/ardour/vst_plugin.h | 8 +- libs/ardour/ardour/vst_types.h | 18 +- libs/ardour/ardour/windows_vst_plugin.h | 2 +- libs/ardour/async_midi_port.cc | 24 +- libs/ardour/audio_diskstream.cc | 58 +- libs/ardour/audio_playlist.cc | 12 +- libs/ardour/audio_playlist_importer.cc | 2 +- libs/ardour/audio_track.cc | 8 +- libs/ardour/audio_track_importer.cc | 6 +- libs/ardour/audio_unit.cc | 22 +- libs/ardour/audioengine.cc | 70 +-- libs/ardour/audiofilesource.cc | 2 +- libs/ardour/audioregion.cc | 76 +-- libs/ardour/audiosource.cc | 14 +- libs/ardour/auditioner.cc | 10 +- libs/ardour/automatable.cc | 4 +- libs/ardour/automation_list.cc | 4 +- libs/ardour/automation_watch.cc | 10 +- libs/ardour/buffer_set.cc | 2 +- libs/ardour/bundle.cc | 6 +- libs/ardour/butler.cc | 16 +- libs/ardour/control_protocol_manager.cc | 22 +- libs/ardour/cycle_timer.cc | 6 +- libs/ardour/delivery.cc | 4 +- libs/ardour/diskstream.cc | 8 +- libs/ardour/engine_slave.cc | 2 +- libs/ardour/engine_state_controller.cc | 8 +- libs/ardour/enums.cc | 2 +- libs/ardour/event_type_map.cc | 2 +- libs/ardour/export_filename.cc | 2 +- libs/ardour/export_graph_builder.cc | 2 +- libs/ardour/export_handler.cc | 16 +- libs/ardour/export_profile_manager.cc | 8 +- libs/ardour/file_source.cc | 12 +- libs/ardour/filesystem_paths.cc | 10 +- libs/ardour/filter.cc | 6 +- libs/ardour/globals.cc | 38 +- libs/ardour/graph.cc | 2 +- libs/ardour/import.cc | 6 +- libs/ardour/instrument_info.cc | 18 +- libs/ardour/internal_return.cc | 2 +- libs/ardour/internal_send.cc | 6 +- libs/ardour/io.cc | 22 +- libs/ardour/io_processor.cc | 16 +- libs/ardour/ladspa_plugin.cc | 8 +- libs/ardour/linux_vst_support.cc | 104 ++-- libs/ardour/location.cc | 12 +- libs/ardour/lv2_plugin.cc | 2 +- libs/ardour/midi_buffer.cc | 42 +- libs/ardour/midi_diskstream.cc | 38 +- libs/ardour/midi_model.cc | 10 +- libs/ardour/midi_patch_manager.cc | 4 +- libs/ardour/midi_port.cc | 28 +- libs/ardour/midi_ring_buffer.cc | 2 +- libs/ardour/midi_scene_change.cc | 2 +- libs/ardour/midi_scene_changer.cc | 26 +- libs/ardour/midi_state_tracker.cc | 2 +- libs/ardour/midi_track.cc | 24 +- libs/ardour/midi_ui.cc | 10 +- libs/ardour/midiport_manager.cc | 6 +- libs/ardour/monitor_processor.cc | 2 +- libs/ardour/pannable.cc | 2 +- libs/ardour/panner_shell.cc | 4 +- libs/ardour/playlist.cc | 82 +-- libs/ardour/playlist_factory.cc | 18 +- libs/ardour/plugin.cc | 2 +- libs/ardour/plugin_insert.cc | 10 +- libs/ardour/port.cc | 12 +- libs/ardour/port_insert.cc | 2 +- libs/ardour/port_manager.cc | 24 +- libs/ardour/port_set.cc | 4 +- libs/ardour/processor.cc | 10 +- libs/ardour/quantize.cc | 10 +- libs/ardour/region.cc | 4 +- libs/ardour/region_factory.cc | 14 +- libs/ardour/route.cc | 76 +-- libs/ardour/route_graph.cc | 12 +- libs/ardour/route_group.cc | 4 +- libs/ardour/search_paths.cc | 2 +- libs/ardour/send.cc | 8 +- libs/ardour/session.cc | 284 ++++----- libs/ardour/session_click.cc | 4 +- libs/ardour/session_events.cc | 2 +- libs/ardour/session_export.cc | 8 +- libs/ardour/session_metadata.cc | 2 +- libs/ardour/session_midi.cc | 6 +- libs/ardour/session_playlists.cc | 2 +- libs/ardour/session_process.cc | 8 +- libs/ardour/session_rtevents.cc | 6 +- libs/ardour/session_transport.cc | 82 +-- libs/ardour/smf_source.cc | 10 +- libs/ardour/sndfilesource.cc | 10 +- libs/ardour/soundcloud_upload.cc | 2 +- libs/ardour/source.cc | 2 +- libs/ardour/source_factory.cc | 4 +- libs/ardour/sse_functions_avx.cc | 2 +- libs/ardour/template_utils.cc | 4 +- libs/ardour/tempo.cc | 188 +++--- libs/ardour/test/audio_region_read_test.cc | 6 +- libs/ardour/test/audio_region_test.cc | 6 +- .../test/automation_list_property_test.cc | 2 +- libs/ardour/test/bbt_test.cc | 2 +- libs/ardour/test/combine_regions_test.cc | 14 +- libs/ardour/test/control_surfaces_test.cc | 2 +- libs/ardour/test/framepos_minus_beats_test.cc | 14 +- libs/ardour/test/framepos_plus_beats_test.cc | 14 +- libs/ardour/test/framewalk_to_beats_test.cc | 14 +- libs/ardour/test/jack_utils_test.cc | 2 +- libs/ardour/test/load_session.cc | 2 +- libs/ardour/test/midi_clock_slave_test.h | 2 +- libs/ardour/test/mtdm_test.cc | 2 +- .../test/playlist_equivalent_regions_test.cc | 2 +- libs/ardour/test/playlist_read_test.cc | 16 +- libs/ardour/test/playlist_read_test.h | 4 +- libs/ardour/test/profiling/load_session.cc | 2 +- libs/ardour/test/tempo_test.cc | 6 +- libs/ardour/test/test_util.cc | 2 +- libs/ardour/test/testrunner.cc | 10 +- libs/ardour/ticker.cc | 16 +- libs/ardour/track.cc | 44 +- libs/ardour/utils.cc | 2 +- libs/ardour/windows_vst_plugin.cc | 2 +- .../audiographer/broadcast_info.h | 2 +- libs/audiographer/audiographer/debug_utils.h | 2 +- .../audiographer/flag_debuggable.h | 4 +- libs/audiographer/audiographer/flag_field.h | 26 +- .../audiographer/general/chunker.h | 18 +- .../audiographer/general/deinterleaver.h | 34 +- .../audiographer/general/interleaver.h | 36 +- .../audiographer/general/normalizer.h | 4 +- .../audiographer/general/peak_reader.h | 8 +- .../general/sample_format_converter.h | 8 +- .../audiographer/general/silence_trimmer.h | 74 +-- .../audiographer/general/sr_converter.h | 6 +- .../audiographer/general/threader.h | 30 +- .../audiographer/process_context.h | 48 +- libs/audiographer/audiographer/routines.h | 8 +- libs/audiographer/audiographer/sink.h | 4 +- .../audiographer/sndfile/sndfile.h | 6 +- .../audiographer/sndfile/sndfile_base.h | 2 +- .../audiographer/sndfile/sndfile_reader.h | 10 +- .../audiographer/sndfile/sndfile_writer.h | 14 +- libs/audiographer/audiographer/source.h | 8 +- libs/audiographer/audiographer/type_utils.h | 8 +- libs/audiographer/audiographer/types.h | 4 +- .../audiographer/utils/listed_source.h | 6 +- libs/audiographer/src/debug_utils.cc | 4 +- libs/audiographer/src/general/normalizer.cc | 6 +- .../src/general/sample_format_converter.cc | 12 +- libs/audiographer/src/general/sr_converter.cc | 24 +- .../tests/general/chunker_test.cc | 50 +- .../tests/general/deinterleaver_test.cc | 28 +- .../general/interleaver_deinterleaver_test.cc | 34 +- .../tests/general/interleaver_test.cc | 10 +- .../tests/general/normalizer_test.cc | 10 +- .../tests/general/peak_reader_test.cc | 6 +- .../general/sample_format_converter_test.cc | 48 +- .../tests/general/silence_trimmer_test.cc | 48 +- .../tests/general/sr_converter_test.cc | 28 +- .../tests/general/threader_test.cc | 42 +- .../tests/sndfile/tmp_file_test.cc | 4 +- libs/audiographer/tests/type_utils_test.cc | 28 +- libs/audiographer/tests/utils.h | 6 +- .../tests/utils/identity_vertex_test.cc | 28 +- libs/backends/asio/asio_backend.cc | 2 +- libs/backends/coreaudio/coreaudio_backend.cc | 2 +- libs/backends/jack/jack_audiobackend.cc | 36 +- libs/backends/jack/jack_audiobackend.h | 2 +- libs/backends/jack/jack_connection.cc | 2 +- libs/backends/jack/jack_portengine.cc | 12 +- libs/backends/jack/jack_session.cc | 14 +- .../wavesaudio/portmidi/src/pm_win/pmwinmm.c | 2 +- .../backends/wavesaudio/waves_audiobackend.cc | 4 +- libs/backends/wavesaudio/waves_midi_device.cc | 10 +- .../wavesaudio/wavesapi/BasicTypes/WCFourCC.h | 4 +- .../wavesapi/BasicTypes/WTByteOrder.h | 2 +- .../wavesaudio/wavesapi/BasicTypes/WUComPtr.h | 8 +- .../wavesapi/BasicTypes/WUMathConsts.h | 2 +- .../wavesaudio/wavesapi/BasicTypes/WUTypes.h | 4 +- .../wavesapi/MiscUtils/MinMaxUtilities.h | 6 +- .../wavesapi/MiscUtils/UMicroseconds.cpp | 4 +- .../wavesapi/MiscUtils/UMicroseconds.h | 12 +- .../wavesapi/MiscUtils/WCFixedString.h | 34 +- .../wavesaudio/wavesapi/MiscUtils/WUErrors.h | 42 +- .../wavesapi/MiscUtils/safe_delete.h | 2 +- .../wavesapi/Threads/WCThreadSafe.h | 4 +- .../wavesapi/WavesPublicAPI/wstdint.h | 2 +- .../wavesaudio/wavesapi/akupara/basics.hpp | 2 +- .../akupara/compiletime_functions.hpp | 2 +- .../wavesapi/akupara/threading/atomic_ops.hpp | 2 +- .../akupara/threading/atomic_ops_gcc_x86.hpp | 8 +- .../devicemanager/WCMRAudioDeviceManager.cpp | 20 +- .../devicemanager/WCMRAudioDeviceManager.h | 18 +- .../WCMRCoreAudioDeviceManager.h | 16 +- .../devicemanager/WCMRNativeAudio.cpp | 14 +- .../WCMRPortAudioDeviceManager.cpp | 104 ++-- .../WCMRPortAudioDeviceManager.h | 10 +- libs/canvas/arc.cc | 20 +- libs/canvas/arrow.cc | 18 +- libs/canvas/benchmark/benchmark.h | 2 +- libs/canvas/benchmark/items_at_point.cc | 6 +- libs/canvas/benchmark/render_from_log.cc | 6 +- libs/canvas/benchmark/render_parts.cc | 6 +- libs/canvas/benchmark/render_whole.cc | 4 +- libs/canvas/canvas.cc | 56 +- libs/canvas/canvas/arc.h | 2 +- libs/canvas/canvas/arrow.h | 4 +- libs/canvas/canvas/canvas.h | 8 +- libs/canvas/canvas/circle.h | 2 +- libs/canvas/canvas/colors.h | 10 +- libs/canvas/canvas/fill.h | 2 +- libs/canvas/canvas/flag.h | 4 +- libs/canvas/canvas/item.h | 18 +- libs/canvas/canvas/line.h | 2 +- libs/canvas/canvas/line_set.h | 2 +- libs/canvas/canvas/lookup_table.h | 2 +- libs/canvas/canvas/outline.h | 2 +- libs/canvas/canvas/poly_item.h | 2 +- libs/canvas/canvas/poly_line.h | 6 +- libs/canvas/canvas/polygon.h | 2 +- libs/canvas/canvas/rectangle.h | 2 +- libs/canvas/canvas/root_group.h | 2 +- libs/canvas/canvas/ruler.h | 10 +- libs/canvas/canvas/scroll_group.h | 2 +- libs/canvas/canvas/tracking_text.h | 2 +- libs/canvas/canvas/types.h | 20 +- libs/canvas/canvas/wave_view.h | 48 +- libs/canvas/canvas/widget.h | 2 +- libs/canvas/colors.cc | 22 +- libs/canvas/colorspace.cc | 70 +-- libs/canvas/curve.cc | 4 +- libs/canvas/debug.cc | 2 +- libs/canvas/fill.cc | 6 +- libs/canvas/flag.cc | 2 +- libs/canvas/image.cc | 4 +- libs/canvas/item.cc | 60 +- libs/canvas/line.cc | 30 +- libs/canvas/line_set.cc | 10 +- libs/canvas/lookup_table.cc | 12 +- libs/canvas/pixbuf.cc | 4 +- libs/canvas/poly_item.cc | 16 +- libs/canvas/poly_line.cc | 16 +- libs/canvas/polygon.cc | 6 +- libs/canvas/rectangle.cc | 38 +- libs/canvas/root_group.cc | 2 +- libs/canvas/ruler.cc | 6 +- libs/canvas/scroll_group.cc | 6 +- libs/canvas/stateful_image.cc | 14 +- libs/canvas/test/arrow.cc | 2 +- libs/canvas/test/group.cc | 10 +- libs/canvas/test/gtk_drag.cc | 6 +- libs/canvas/test/gtk_many.cc | 6 +- libs/canvas/test/gtk_movement.cc | 6 +- libs/canvas/test/gtk_scene.cc | 4 +- libs/canvas/test/gtk_viewport.cc | 8 +- libs/canvas/test/optimizing_lookup_table.cc | 8 +- libs/canvas/test/render.cc | 2 +- libs/canvas/test/types.cc | 2 +- libs/canvas/test/types.h | 2 +- libs/canvas/test/wave_view.cc | 20 +- libs/canvas/test/xml.cc | 2 +- libs/canvas/test/xml.h | 2 +- libs/canvas/text.cc | 16 +- libs/canvas/tracking_text.cc | 4 +- libs/canvas/utils.cc | 2 +- libs/canvas/wave_view.cc | 154 ++--- libs/canvas/xfade_curve.cc | 2 +- libs/clearlooks-newer/animation.c | 70 +-- libs/clearlooks-newer/cairo-support.c | 74 +-- libs/clearlooks-newer/clearlooks_draw.c | 342 +++++------ .../clearlooks-newer/clearlooks_draw_glossy.c | 176 +++--- libs/clearlooks-newer/clearlooks_draw_gummy.c | 16 +- .../clearlooks_draw_inverted.c | 148 ++--- libs/clearlooks-newer/clearlooks_rc_style.c | 4 +- libs/clearlooks-newer/clearlooks_style.c | 268 ++++----- libs/clearlooks-newer/clearlooks_style.h | 2 +- libs/clearlooks-newer/clearlooks_types.h | 12 +- libs/clearlooks-newer/support.c | 46 +- libs/clearlooks-newer/widget-information.c | 6 +- libs/clearlooks-older/clearlooks_draw.c | 304 +++++----- libs/clearlooks-older/clearlooks_draw.h | 28 +- libs/clearlooks-older/clearlooks_rc_style.c | 20 +- libs/clearlooks-older/clearlooks_style.c | 540 +++++++++--------- libs/clearlooks-older/clearlooks_style.h | 20 +- libs/clearlooks-older/support.c | 156 ++--- libs/clearlooks-older/support.h | 6 +- libs/evoral/evoral/ControlList.hpp | 4 +- libs/evoral/evoral/ControlSet.hpp | 2 +- libs/evoral/evoral/Range.hpp | 10 +- libs/evoral/evoral/TimeConverter.hpp | 4 +- libs/evoral/evoral/midi_util.h | 2 +- libs/evoral/src/Control.cpp | 4 +- libs/evoral/src/ControlList.cpp | 64 +-- libs/evoral/src/Curve.cpp | 2 +- libs/evoral/src/Event.cpp | 2 +- libs/evoral/src/Note.cpp | 2 +- libs/evoral/src/Sequence.cpp | 24 +- libs/evoral/src/libsmf/smf.c | 2 +- libs/evoral/src/libsmf/smf_decode.c | 6 +- libs/evoral/src/libsmf/smf_load.c | 18 +- libs/evoral/src/libsmf/smf_save.c | 2 +- libs/evoral/src/libsmf/smf_tempo.c | 6 +- libs/evoral/src/libsmf/smfsh.c | 6 +- libs/evoral/test/CurveTest.cpp | 2 +- libs/evoral/test/RangeTest.hpp | 2 +- libs/gtkmm2ext/actions.cc | 12 +- libs/gtkmm2ext/binding_proxy.cc | 6 +- libs/gtkmm2ext/cairo_packer.cc | 4 +- libs/gtkmm2ext/cairo_widget.cc | 12 +- libs/gtkmm2ext/cairocell.cc | 20 +- .../gtkmm2ext/cell_renderer_color_selector.cc | 12 +- libs/gtkmm2ext/cell_renderer_pixbuf_multi.cc | 2 +- libs/gtkmm2ext/cell_renderer_pixbuf_toggle.cc | 2 +- libs/gtkmm2ext/choice.cc | 4 +- libs/gtkmm2ext/click_box.cc | 10 +- libs/gtkmm2ext/dndtreeview.cc | 4 +- libs/gtkmm2ext/fader.cc | 28 +- libs/gtkmm2ext/grouped_buttons.cc | 4 +- libs/gtkmm2ext/gtk_ui.cc | 10 +- libs/gtkmm2ext/gtkmm2ext/actions.h | 2 +- libs/gtkmm2ext/gtkmm2ext/auto_spin.h | 2 +- libs/gtkmm2ext/gtkmm2ext/barcontroller.h | 2 +- libs/gtkmm2ext/gtkmm2ext/bindable_button.h | 6 +- libs/gtkmm2ext/gtkmm2ext/binding_proxy.h | 6 +- libs/gtkmm2ext/gtkmm2ext/cairo_widget.h | 10 +- libs/gtkmm2ext/gtkmm2ext/cairocell.h | 6 +- .../gtkmm2ext/cell_renderer_pixbuf_multi.h | 2 +- .../gtkmm2ext/cell_renderer_pixbuf_toggle.h | 2 +- libs/gtkmm2ext/gtkmm2ext/dndtreeview.h | 22 +- libs/gtkmm2ext/gtkmm2ext/dndvbox.h | 86 +-- libs/gtkmm2ext/gtkmm2ext/focus_entry.h | 2 +- libs/gtkmm2ext/gtkmm2ext/grouped_buttons.h | 2 +- libs/gtkmm2ext/gtkmm2ext/gtk_ui.h | 2 +- libs/gtkmm2ext/gtkmm2ext/keyboard.h | 2 +- libs/gtkmm2ext/gtkmm2ext/motionfeedback.h | 4 +- libs/gtkmm2ext/gtkmm2ext/persistent_tooltip.h | 2 +- libs/gtkmm2ext/gtkmm2ext/pixscroller.h | 2 +- libs/gtkmm2ext/gtkmm2ext/scroomer.h | 2 +- libs/gtkmm2ext/gtkmm2ext/slider_controller.h | 2 +- libs/gtkmm2ext/gtkmm2ext/textviewer.h | 2 +- libs/gtkmm2ext/gtkmm2ext/utils.h | 10 +- libs/gtkmm2ext/gtkmm2ext/widget_state.h | 2 +- libs/gtkmm2ext/idle_adjustment.cc | 4 +- libs/gtkmm2ext/keyboard.cc | 2 +- libs/gtkmm2ext/motionfeedback.cc | 30 +- libs/gtkmm2ext/persistent_tooltip.cc | 4 +- libs/gtkmm2ext/pixscroller.cc | 12 +- libs/gtkmm2ext/popup.cc | 4 +- libs/gtkmm2ext/prompter.cc | 8 +- libs/gtkmm2ext/scroomer.cc | 26 +- libs/gtkmm2ext/selector.cc | 2 +- libs/gtkmm2ext/sync-menu.c | 4 +- libs/gtkmm2ext/tearoff.cc | 12 +- libs/gtkmm2ext/textviewer.cc | 2 +- libs/gtkmm2ext/utils.cc | 24 +- libs/gtkmm2ext/window_title.cc | 2 +- libs/midi++2/channel.cc | 8 +- libs/midi++2/ipmidi_port.cc | 20 +- libs/midi++2/midi++/channel.h | 10 +- libs/midi++2/midi++/ipmidi_port.h | 2 +- libs/midi++2/midi++/midnam_patch.h | 46 +- libs/midi++2/midi++/mmc.h | 26 +- libs/midi++2/midi++/parser.h | 12 +- libs/midi++2/midi++/port.h | 6 +- libs/midi++2/miditrace.cc | 2 +- libs/midi++2/midnam_patch.cc | 14 +- libs/midi++2/mmc.cc | 26 +- libs/midi++2/mmctest.cc | 2 +- libs/midi++2/mtc.cc | 44 +- libs/midi++2/parser.cc | 138 ++--- libs/midi++2/port.cc | 8 +- libs/panners/1in2out/panner_1in2out.cc | 4 +- libs/panners/2in2out/panner_2in2out.cc | 8 +- libs/panners/2in2out/panner_2in2out.h | 2 +- libs/pbd/base_ui.cc | 6 +- libs/pbd/boost_debug.cc | 20 +- libs/pbd/controllable_descriptor.cc | 12 +- libs/pbd/convert.cc | 12 +- libs/pbd/crossthread.posix.cc | 2 +- libs/pbd/crossthread.win.cc | 12 +- libs/pbd/debug.cc | 4 +- libs/pbd/enumwriter.cc | 10 +- libs/pbd/epa.cc | 4 +- libs/pbd/event_loop.cc | 2 +- libs/pbd/ffs.cc | 2 +- libs/pbd/fpu.cc | 32 +- libs/pbd/id.cc | 2 +- libs/pbd/malign.cc | 4 +- libs/pbd/md5.cc | 12 +- libs/pbd/mountpoint.cc | 10 +- libs/pbd/msvc/getopt_long.c | 4 +- libs/pbd/pathexpand.cc | 14 +- libs/pbd/pbd.cc | 4 +- libs/pbd/pbd/abstract_ui.cc | 20 +- libs/pbd/pbd/abstract_ui.h | 4 +- libs/pbd/pbd/atomic_counter.h | 2 +- libs/pbd/pbd/base_ui.h | 2 +- libs/pbd/pbd/command.h | 4 +- libs/pbd/pbd/compose.h | 8 +- libs/pbd/pbd/controllable.h | 2 +- libs/pbd/pbd/crossthread.h | 4 +- libs/pbd/pbd/debug_rt_alloc.h | 2 +- libs/pbd/pbd/destructible.h | 2 +- libs/pbd/pbd/enumwriter.h | 2 +- libs/pbd/pbd/epa.h | 2 +- libs/pbd/pbd/fastlog.h | 4 +- libs/pbd/pbd/fpu.h | 4 +- libs/pbd/pbd/functor_command.h | 2 +- libs/pbd/pbd/id.h | 2 +- libs/pbd/pbd/md5.h | 10 +- libs/pbd/pbd/memento_command.h | 8 +- libs/pbd/pbd/pool.h | 4 +- libs/pbd/pbd/properties.h | 22 +- libs/pbd/pbd/property_basics.h | 14 +- libs/pbd/pbd/property_list.h | 2 +- libs/pbd/pbd/receiver.h | 2 +- libs/pbd/pbd/ringbuffer.h | 32 +- libs/pbd/pbd/ringbufferNPT.h | 32 +- libs/pbd/pbd/search_path.h | 4 +- libs/pbd/pbd/selectable.h | 4 +- libs/pbd/pbd/sequence_property.h | 16 +- libs/pbd/pbd/signals.h | 16 +- libs/pbd/pbd/stacktrace.h | 4 +- libs/pbd/pbd/stateful.h | 4 +- libs/pbd/pbd/stateful_diff_command.h | 2 +- libs/pbd/pbd/stl_delete.h | 4 +- libs/pbd/pbd/touchable.h | 8 +- libs/pbd/pbd/transmitter.h | 2 +- libs/pbd/pbd/undo.h | 10 +- libs/pbd/pbd/unwind.h | 2 +- libs/pbd/pbd/xml++.h | 4 +- libs/pbd/pool.cc | 12 +- libs/pbd/property_list.cc | 2 +- libs/pbd/pthread_utils.cc | 8 +- libs/pbd/search_path.cc | 2 +- libs/pbd/semutils.cc | 2 +- libs/pbd/shortpath.cc | 4 +- libs/pbd/stacktrace.cc | 10 +- libs/pbd/stateful.cc | 14 +- libs/pbd/strsplit.cc | 4 +- libs/pbd/system_exec.cc | 2 +- libs/pbd/test/scalar_properties.cc | 2 +- libs/pbd/test/scalar_properties.h | 2 +- libs/pbd/test/signals_test.cc | 4 +- libs/pbd/test/testrunner.cc | 8 +- libs/pbd/test/xpath.cc | 36 +- libs/pbd/textreceiver.cc | 2 +- libs/pbd/transmitter.cc | 6 +- libs/pbd/undo.cc | 2 +- libs/pbd/whitespace.cc | 10 +- libs/pbd/windows_special_dirs.cc | 2 +- libs/pbd/xml++.cc | 22 +- libs/ptformat/ptfformat.cc | 2 +- libs/qm-dsp/base/Window.h | 16 +- libs/qm-dsp/dsp/chromagram/Chromagram.cpp | 10 +- libs/qm-dsp/dsp/chromagram/Chromagram.h | 8 +- libs/qm-dsp/dsp/chromagram/ConstantQ.cpp | 12 +- libs/qm-dsp/dsp/chromagram/ConstantQ.h | 6 +- libs/qm-dsp/dsp/onsets/DetectionFunction.cpp | 22 +- libs/qm-dsp/dsp/onsets/DetectionFunction.h | 2 +- libs/qm-dsp/dsp/onsets/PeakPicking.cpp | 18 +- libs/qm-dsp/dsp/onsets/PeakPicking.h | 6 +- libs/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp | 6 +- libs/qm-dsp/dsp/rateconversion/Decimator.h | 2 +- .../dsp/segmentation/ClusterMeltSegmenter.cpp | 26 +- .../dsp/segmentation/ClusterMeltSegmenter.h | 6 +- libs/qm-dsp/dsp/segmentation/Segmenter.cpp | 4 +- libs/qm-dsp/dsp/segmentation/Segmenter.h | 2 +- libs/qm-dsp/dsp/segmentation/cluster_melt.c | 68 +-- .../dsp/segmentation/cluster_segmenter.c | 76 +-- .../dsp/signalconditioning/DFProcess.cpp | 16 +- .../qm-dsp/dsp/signalconditioning/DFProcess.h | 2 +- .../dsp/signalconditioning/FiltFilt.cpp | 16 +- libs/qm-dsp/dsp/signalconditioning/Filter.h | 2 +- libs/qm-dsp/dsp/signalconditioning/Framer.cpp | 8 +- libs/qm-dsp/dsp/tempotracking/DownBeat.cpp | 2 +- .../qm-dsp/dsp/tempotracking/TempoTrackV2.cpp | 8 +- .../dsp/tonal/ChangeDetectionFunction.cpp | 34 +- .../dsp/tonal/ChangeDetectionFunction.h | 2 +- libs/qm-dsp/dsp/tonal/TCSgram.cpp | 4 +- libs/qm-dsp/dsp/tonal/TCSgram.h | 2 +- libs/qm-dsp/dsp/tonal/TonalEstimator.cpp | 20 +- libs/qm-dsp/dsp/tonal/TonalEstimator.h | 22 +- libs/qm-dsp/dsp/transforms/FFT.cpp | 2 +- libs/qm-dsp/dsp/wavelet/Wavelet.cpp | 8 +- libs/qm-dsp/hmm/hmm.c | 242 ++++---- libs/qm-dsp/maths/MathUtilities.cpp | 26 +- libs/qm-dsp/maths/MathUtilities.h | 2 +- libs/qm-dsp/maths/pca/pca.c | 20 +- libs/surfaces/control_protocol/basic_ui.cc | 48 +- .../control_protocol/control_protocol.cc | 4 +- .../control_protocol/basic_ui.h | 2 +- .../control_protocol/control_protocol.h | 4 +- .../control_protocol/control_protocol/types.h | 2 +- .../frontier/kernel_drivers/tests/tranzport.c | 4 +- .../kernel_drivers/tests/tranzport_lights.c | 4 +- .../frontier/kernel_drivers/tranzport.c | 12 +- .../frontier/tests/tranzport_lights.c | 4 +- libs/surfaces/frontier/tranzport/interface.cc | 4 +- .../tranzport/tranzport_control_protocol.cc | 42 +- .../tranzport/tranzport_control_protocol.h | 8 +- .../generic_midi_control_protocol.cc | 88 +-- .../generic_midi_control_protocol.h | 6 +- libs/surfaces/generic_midi/gmcp_gui.cc | 12 +- libs/surfaces/generic_midi/interface.cc | 6 +- .../surfaces/generic_midi/midicontrollable.cc | 10 +- libs/surfaces/generic_midi/midicontrollable.h | 4 +- libs/surfaces/generic_midi/midiinvokable.cc | 2 +- libs/surfaces/generic_midi/midiinvokable.h | 2 +- libs/surfaces/mackie/button.cc | 4 +- libs/surfaces/mackie/button.h | 10 +- libs/surfaces/mackie/control_group.h | 12 +- libs/surfaces/mackie/controls.cc | 6 +- libs/surfaces/mackie/controls.h | 6 +- libs/surfaces/mackie/device_info.cc | 6 +- libs/surfaces/mackie/device_info.h | 6 +- libs/surfaces/mackie/device_profile.cc | 2 +- libs/surfaces/mackie/device_profile.h | 12 +- libs/surfaces/mackie/fader.cc | 2 +- libs/surfaces/mackie/fader.h | 6 +- libs/surfaces/mackie/gui.cc | 40 +- libs/surfaces/mackie/gui.h | 4 +- libs/surfaces/mackie/interface.cc | 6 +- libs/surfaces/mackie/jog_wheel.h | 2 +- libs/surfaces/mackie/led.cc | 10 +- libs/surfaces/mackie/led.h | 4 +- .../mackie/mackie_control_exception.h | 6 +- .../surfaces/mackie/mackie_control_protocol.h | 32 +- libs/surfaces/mackie/mcp_buttons.cc | 6 +- libs/surfaces/mackie/meter.cc | 26 +- libs/surfaces/mackie/meter.h | 2 +- libs/surfaces/mackie/midi_byte_array.cc | 2 +- libs/surfaces/mackie/midi_byte_array.h | 4 +- libs/surfaces/mackie/pot.cc | 6 +- libs/surfaces/mackie/strip.cc | 148 ++--- libs/surfaces/mackie/strip.h | 6 +- libs/surfaces/mackie/surface.cc | 68 +-- libs/surfaces/mackie/surface.h | 12 +- libs/surfaces/mackie/surface_port.cc | 10 +- libs/surfaces/mackie/surface_port.h | 4 +- libs/surfaces/mackie/timer.h | 6 +- libs/surfaces/mackie/types.h | 20 +- libs/surfaces/osc/interface.cc | 2 +- libs/surfaces/osc/osc.h | 22 +- libs/surfaces/osc/osc_controllable.cc | 4 +- libs/surfaces/osc/osc_route_observer.cc | 8 +- libs/surfaces/osc/osc_route_observer.h | 4 +- libs/surfaces/tranzport/bling.cc | 2 +- libs/surfaces/tranzport/buttons.cc | 2 +- libs/surfaces/tranzport/general.cc | 12 +- libs/surfaces/tranzport/init.cc | 6 +- libs/surfaces/tranzport/interface.cc | 4 +- libs/surfaces/tranzport/io.cc | 6 +- libs/surfaces/tranzport/io_kernel.cc | 6 +- libs/surfaces/tranzport/io_usb.cc | 10 +- libs/surfaces/tranzport/lcd.cc | 4 +- libs/surfaces/tranzport/show.cc | 14 +- libs/surfaces/tranzport/state.cc | 2 +- .../tranzport/tranzport_control_protocol.h | 6 +- libs/surfaces/tranzport/wheel.cc | 46 +- libs/surfaces/tranzport/wheel_modes.cc | 12 +- libs/timecode/src/time.cc | 4 +- libs/timecode/timecode/bbt_time.h | 10 +- libs/timecode/timecode/time.h | 8 +- libs/vamp-plugins/AmplitudeFollower.cpp | 8 +- libs/vamp-plugins/AmplitudeFollower.h | 4 +- tools/jacktest.c | 6 +- tools/omf/loader.cc | 4 +- tools/omf/omftool.cc | 80 +-- tools/omf/omftool.h | 12 +- tools/readtest.c | 8 +- tools/sanity_check/main.cpp | 26 +- tools/sfrtest.cc | 12 +- tools/sftest.cc | 14 +- 822 files changed, 6861 insertions(+), 6861 deletions(-) diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc index 2e58c646ea..0a14647002 100644 --- a/gtk2_ardour/add_route_dialog.cc +++ b/gtk2_ardour/add_route_dialog.cc @@ -323,7 +323,7 @@ void AddRouteDialog::refill_track_modes () { vector s; - + s.push_back (_("Normal")); if (!ARDOUR::Profile->get_sae ()) { @@ -392,7 +392,7 @@ AddRouteDialog::channels () ret.set (DataType::MIDI, 1); break; } - + return ret; } diff --git a/gtk2_ardour/add_route_dialog.h b/gtk2_ardour/add_route_dialog.h index d0fbeae3d4..eb38338f1f 100644 --- a/gtk2_ardour/add_route_dialog.h +++ b/gtk2_ardour/add_route_dialog.h @@ -64,7 +64,7 @@ class AddRouteDialog : public ArdourDialog bool name_template_is_default () const; std::string track_template (); ARDOUR::PluginInfoPtr requested_instrument (); - + ARDOUR::TrackMode mode(); ARDOUR::RouteGroup* route_group (); enum InsertAt { diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index b2c2c83d70..7eaa960980 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -627,7 +627,7 @@ ArdourButton::set_colors () /* The inactive color for the LED is just a fairly dark version of the * active color. */ - + ArdourCanvas::HSV inactive (led_active_color); inactive.v = 0.35; diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h index 9df1089246..27b4078950 100644 --- a/gtk2_ardour/ardour_button.h +++ b/gtk2_ardour/ardour_button.h @@ -89,7 +89,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable void set_layout_ellipsize_width (int w); void set_layout_font (const Pango::FontDescription&); void set_text_ellipsize (Pango::EllipsizeMode); - + sigc::signal signal_led_clicked; sigc::signal signal_clicked; diff --git a/gtk2_ardour/ardour_display.cc b/gtk2_ardour/ardour_display.cc index 4cfffbcbd4..17f3dc5dde 100644 --- a/gtk2_ardour/ardour_display.cc +++ b/gtk2_ardour/ardour_display.cc @@ -63,7 +63,7 @@ ArdourDisplay::~ArdourDisplay () bool ArdourDisplay::on_button_press_event (GdkEventButton*) { - _menu.popup (1, gtk_get_current_event_time()); + _menu.popup (1, gtk_get_current_event_time()); return true; } @@ -84,12 +84,12 @@ ArdourDisplay::on_scroll_event (GdkEventScroll* ev) boost::shared_ptr c = binding_proxy.get_controllable(); if (c) { float val = c->get_interface(); - + if ( ev->direction == GDK_SCROLL_UP ) val += 0.05 * scale; //by default, we step in 1/20ths of the knob travel else val -= 0.05 * scale; - + c->set_interface(val); } diff --git a/gtk2_ardour/ardour_dropdown.cc b/gtk2_ardour/ardour_dropdown.cc index 221fe672d9..78100aa952 100644 --- a/gtk2_ardour/ardour_dropdown.cc +++ b/gtk2_ardour/ardour_dropdown.cc @@ -138,7 +138,7 @@ ArdourDropdown::AddMenuElem (Menu_Helpers::Element e) using namespace Menu_Helpers; MenuList& items = _menu.items (); - + items.push_back (e); } diff --git a/gtk2_ardour/ardour_knob.cc b/gtk2_ardour/ardour_knob.cc index 99890ad2e7..f7e4a939f2 100644 --- a/gtk2_ardour/ardour_knob.cc +++ b/gtk2_ardour/ardour_knob.cc @@ -80,13 +80,13 @@ void ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) { cairo_pattern_t* shade_pattern; - + float width = get_width(); float height = get_height(); - + const float scale = min(width, height); const float pointer_thickness = 3.0 * (scale/80); //(if the knob is 80 pixels wide, we want a 3-pix line on it) - + const float start_angle = ((180 - 65) * G_PI) / 180; const float end_angle = ((360 + 65) * G_PI) / 180; @@ -97,13 +97,13 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) const float value_angle = start_angle + (_val * (end_angle - start_angle)); const float zero_angle = start_angle + (zero * (end_angle - start_angle)); - + float value_x = cos (value_angle); float value_y = sin (value_angle); float xc = 0.5 + width/ 2.0; float yc = 0.5 + height/ 2.0; - + cairo_translate (cr, xc, yc); //after this, everything is based on the center of the knob //get the knob color from the theme @@ -111,11 +111,11 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) float center_radius = 0.48*scale; float border_width = 0.8; - + bool arc = (_elements & Arc)==Arc; bool bevel = (_elements & Bevel)==Bevel; bool flat = _flat_buttons; - + if ( arc ) { center_radius = scale*0.33; @@ -123,7 +123,7 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) float outer_progress_radius = scale*0.48; float progress_width = (outer_progress_radius-inner_progress_radius); float progress_radius = inner_progress_radius + progress_width/2.0; - + //dark arc background cairo_set_source_rgb (cr, 0.3, 0.3, 0.3 ); cairo_set_line_width (cr, progress_width); @@ -185,7 +185,7 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) cairo_stroke (cr); #endif } - + if (!flat) { //knob shadow cairo_save(cr); @@ -199,8 +199,8 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) ArdourCanvas::set_source_rgba(cr, knob_color); cairo_arc (cr, 0, 0, center_radius, 0, 2.0*G_PI); cairo_fill (cr); - - //gradient + + //gradient if (bevel) { //knob gradient shade_pattern = cairo_pattern_create_linear (0.0, -yc, 0.0, yc); //note we have to offset the gradient from our centerpoint @@ -217,7 +217,7 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) ArdourCanvas::set_source_rgb_a (cr, knob_color, 0.5 ); cairo_arc (cr, 0, 0, center_radius-pointer_thickness, 0, 2.0*G_PI); cairo_fill (cr); - } else { + } else { //radial gradient shade_pattern = cairo_pattern_create_radial ( -center_radius, -center_radius, 1, -center_radius, -center_radius, center_radius*2.5 ); //note we have to offset the gradient from our centerpoint cairo_pattern_add_color_stop_rgba (shade_pattern, 0.0, 1,1,1, 0.2); @@ -227,21 +227,21 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) cairo_fill (cr); cairo_pattern_destroy (shade_pattern); } - + } else { //inner circle ArdourCanvas::set_source_rgba(cr, knob_color); cairo_arc (cr, 0, 0, center_radius, 0, 2.0*G_PI); cairo_fill (cr); } - + //black knob border cairo_set_line_width (cr, border_width); cairo_set_source_rgba (cr, 0,0,0, 1 ); cairo_arc (cr, 0, 0, center_radius, 0, 2.0*G_PI); cairo_stroke (cr); - + //line shadow if (!flat) { cairo_save(cr); @@ -254,7 +254,7 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) cairo_stroke (cr); cairo_restore(cr); } - + //line cairo_set_source_rgba (cr, 1,1,1, 1 ); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); @@ -269,8 +269,8 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *) cairo_arc (cr, 0, 0, center_radius, 0, 2.0*G_PI); cairo_fill (cr); } - - cairo_identity_matrix(cr); + + cairo_identity_matrix(cr); } void @@ -305,11 +305,11 @@ ArdourKnob::on_scroll_event (GdkEventScroll* ev) boost::shared_ptr c = binding_proxy.get_controllable(); if (c) { float val = c->get_interface(); - + if ( ev->direction == GDK_SCROLL_UP ) val += scale; else - val -= scale; + val -= scale; c->set_interface(val); } @@ -408,7 +408,7 @@ ArdourKnob::on_button_press_event (GdkEventButton *ev) if (ev->button != 1 && ev->button != 2) { return false; } - + set_active_state (Gtkmm2ext::ExplicitActive); _tooltip.start_drag(); add_modal_grab(); @@ -506,14 +506,14 @@ ArdourKnob::set_active_state (Gtkmm2ext::ActiveState s) if (_active_state != s) CairoWidget::set_active_state (s); } - + void ArdourKnob::set_visual_state (Gtkmm2ext::VisualState s) { if (_visual_state != s) CairoWidget::set_visual_state (s); } - + bool ArdourKnob::on_focus_in_event (GdkEventFocus* ev) diff --git a/gtk2_ardour/ardour_knob.h b/gtk2_ardour/ardour_knob.h index 29cfb5e4f4..d9a9c94209 100644 --- a/gtk2_ardour/ardour_knob.h +++ b/gtk2_ardour/ardour_knob.h @@ -113,7 +113,7 @@ public: float _val; // current value [0..1] float _normal; // default value, arc float _dead_zone_delta; - + Flags _flags; void action_sensitivity_changed (); diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index bc1587b7cc..500acd6332 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -305,7 +305,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) xmlSetGenericErrorFunc (this, libxml_generic_error_func); xmlSetStructuredErrorFunc (this, libxml_structured_error_func); - + UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed)); boost::function pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1)); UIConfiguration::instance().map_parameters (pc); @@ -441,7 +441,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) /* Trigger setting up the color scheme and loading the GTK RC file */ UIConfiguration::instance().load_rc_file (false); - + _process_thread = new ProcessThread (); _process_thread->init (); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 7ad154f0d4..ce6c74c8c1 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -180,7 +180,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr ARDOUR::Session* the_session() { return _session; } bool get_smart_mode () const; - + int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = ""); int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path); bool ask_about_loading_existing_session (const std::string& session_path); @@ -193,7 +193,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void save_state (const std::string & state_name = "", bool switch_to_it = false); static ARDOUR_UI *instance () { return theArdourUI; } - + PublicEditor& the_editor() { return *editor;} Mixer_UI* the_mixer() { return mixer; } @@ -227,7 +227,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void create_xrun_marker (framepos_t); GUIObjectState* gui_object_state; - + MainClock* primary_clock; MainClock* secondary_clock; void focus_on_clock (); @@ -486,13 +486,13 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void audition_blink (bool); void feedback_blink (bool); void error_blink (bool); - + void set_flat_buttons(); void soloing_changed (bool); void auditioning_changed (bool); void _auditioning_changed (bool); - + bool solo_alert_press (GdkEventButton* ev); bool audition_alert_press (GdkEventButton* ev); bool feedback_alert_press (GdkEventButton *); @@ -543,7 +543,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr Gtk::Label format_label; void update_format (); - + void every_second (); void every_point_one_seconds (); void every_point_zero_something_seconds (); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 4322c7e0ff..d8a1f218ec 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -412,7 +412,7 @@ ARDOUR_UI::setup_transport () shuttle_box = manage (new ShuttleControl); shuttle_box->show (); - + VBox* transport_vbox = manage (new VBox); transport_vbox->set_name ("TransportBase"); transport_vbox->set_border_width (0); @@ -734,4 +734,4 @@ ARDOUR_UI::toggle_follow_edits () UIConfiguration::instance().set_follow_edits (tact->get_active ()); } - + diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 00a16684e1..f41c06a9a1 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -348,7 +348,7 @@ ARDOUR_UI::goto_mixer_window () { Glib::RefPtr win; Glib::RefPtr screen; - + if (editor) { win = editor->get_window (); } @@ -358,7 +358,7 @@ ARDOUR_UI::goto_mixer_window () } else { screen = Gdk::Screen::get_default(); } - + if (g_getenv ("ARDOUR_LOVES_STUPID_TINY_SCREENS") == 0 && screen && screen->get_height() < 700) { Gtk::MessageDialog msg (_("This screen is not tall enough to display the mixer window")); msg.run (); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index fb077e49af..e4379fe432 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -137,7 +137,7 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); ActionManager::write_sensitive_actions.push_back (act); - + act = ActionManager::register_action (main_actions, X_("OpenVideo"), _("Open Video"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::add_video), (Gtk::Window*) 0)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/ardour_window.cc b/gtk2_ardour/ardour_window.cc index 22e32731c0..1cb4202080 100644 --- a/gtk2_ardour/ardour_window.cc +++ b/gtk2_ardour/ardour_window.cc @@ -126,7 +126,7 @@ ArdourWindow::init () if (parent) { set_transient_for (*parent); } - + ARDOUR_UI::CloseAllDialogs.connect (sigc::mem_fun (*this, &ArdourWindow::hide)); proxy = new WM::ProxyTemporary (get_title(), this); diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 54f17725eb..cf55f63c6e 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -151,7 +151,7 @@ AudioClock::on_realize () Gtk::Requisition req; CairoWidget::on_realize (); - + set_clock_dimensions (req); first_width = req.width; @@ -318,7 +318,7 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*) cairo_save (cr); cairo_scale (cr, xscale, yscale); } - + pango_cairo_show_layout (cr, _layout->gobj()); if (xscale != 1.0 || yscale != 1.0) { @@ -507,15 +507,15 @@ AudioClock::on_size_request (Gtk::Requisition* req) Glib::RefPtr style = get_style (); Pango::FontDescription font; int w; - + tmp = Pango::Layout::create (get_pango_context()); - + if (!is_realized()) { font = get_font_for_style (get_name()); } else { font = style->get_font(); } - + tmp->set_font_description (font); font.set_size (INFO_FONT_SIZE); @@ -561,17 +561,17 @@ AudioClock::start_edit (Field f) edit_string.clear (); _layout->set_text (""); } - + input_string.clear (); editing = true; edit_is_negative = false; - + if (f) { input_string = get_field (f); show_edit_status (merge_input_and_edit_string ()); _layout->set_text (edit_string); } - + queue_draw (); Keyboard::magic_widget_grab_focus (); diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h index 40e9644d92..3790fa88ef 100644 --- a/gtk2_ardour/audio_clock.h +++ b/gtk2_ardour/audio_clock.h @@ -87,7 +87,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr * to font distortion. */ void set_scale (double x, double y); - + static void print_minsec (framepos_t, char* buf, size_t bufsize, float frame_rate); sigc::signal ValueChanged; @@ -242,7 +242,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr ARDOUR::framecnt_t parse_as_minsec_distance (const std::string&); ARDOUR::framecnt_t parse_as_bbt_distance (const std::string&); ARDOUR::framecnt_t parse_as_frames_distance (const std::string&); - + void set_font (Pango::FontDescription); void set_colors (); void show_edit_status (int length); diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 73122a269d..706611a81d 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -235,7 +235,7 @@ AudioRegionView::init (bool wfd) if (!Profile->get_sae()) { gain_line.reset (new AudioRegionGainLine (line_name, *this, *group, audio_region()->envelope())); } - + update_envelope_visibility (); gain_line->reset (); @@ -375,7 +375,7 @@ AudioRegionView::fade_out_active_changed () if (end_xfade_rect) { if (audio_region()->fade_out_active()) { end_xfade_rect->set_fill (false); - } else { + } else { end_xfade_rect->set_fill_color (UIConfiguration::instance().color_mod ("inactive crossfade", "inactive crossfade")); end_xfade_rect->set_fill (true); } @@ -420,7 +420,7 @@ AudioRegionView::region_resized (const PropertyChange& what_changed) interesting_stuff.add (ARDOUR::Properties::length); if (what_changed.contains (interesting_stuff)) { - + for (uint32_t n = 0; n < waves.size(); ++n) { waves[n]->region_resized (); } @@ -531,17 +531,17 @@ AudioRegionView::set_height (gdouble height) if (wcnt > 0) { gdouble ht; - + if (!UIConfiguration::instance().get_show_name_highlight() || (height < NAME_HIGHLIGHT_THRESH)) { ht = height / (double) wcnt; } else { ht = (height - NAME_HIGHLIGHT_SIZE) / (double) wcnt; } - + for (uint32_t n = 0; n < wcnt; ++n) { - + gdouble yoff = floor (ht * n); - + waves[n]->set_height (ht); waves[n]->set_y_position (yoff); } @@ -635,7 +635,7 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr ar, f hide_start_xfade (); return; } - + double effective_height; if (_height >= NAME_HIGHLIGHT_THRESH) { @@ -689,7 +689,7 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr ar, double const pwidth = floor(trackview.editor().sample_to_pixel (width)); - + /* the right edge should be right on the region frame is the pixel * width is zero. Hence the additional + 1.0 at the end. */ @@ -731,7 +731,7 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr ar, } /* points *MUST* be in anti-clockwise order */ - + Points points; Points::size_type pi; boost::shared_ptr list (audio_region()->fade_out()); @@ -739,7 +739,7 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr ar, double length = list->length(); points.assign (list->size(), Duple()); - + for (x = list->begin(), pi = 0; x != list->end(); ++x, ++pi) { points[pi].x = _pixel_width - pwidth + (pwidth * ((*x)->when/length)); points[pi].y = effective_height - ((*x)->value * (effective_height - 1.)); @@ -839,7 +839,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr ar, frame npoints = inverse->size(); ipoints.assign (npoints, Duple()); - + Evoral::ControlList::const_iterator x; Points::size_type pi; double length = inverse->length(); @@ -866,7 +866,7 @@ AudioRegionView::redraw_end_xfade () } show_end_xfade(); - + reset_fade_out_shape_width (ar, ar->fade_out()->back()->when); } @@ -930,9 +930,9 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr ar, framecn npoints = inverse->size(); ipoints.assign (npoints, Duple()); - + const double rend = trackview.editor().sample_to_pixel (_region->length() - width); - + Evoral::ControlList::const_iterator x; Points::size_type pi; double length = inverse->length(); @@ -1218,12 +1218,12 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/) /* first waveview starts at 1.0, not 0.0 since that will overlap the * frame */ - + gdouble yoff = which * ht; WaveView *wave = new WaveView (group, audio_region ()); CANVAS_DEBUG_NAME (wave, string_compose ("wave view for chn %1 of %2", which, get_item_name())); - + wave->set_channel (which); wave->set_y_position (yoff); wave->set_height (ht); @@ -1231,9 +1231,9 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/) wave->set_show_zero_line (true); wave->set_clip_level (UIConfiguration::instance().get_waveform_clip_level ()); wave->set_start_shift (1.0); - + wave->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_wave_view_event), wave, this)); - + switch (UIConfiguration::instance().get_waveform_shape()) { case Rectified: wave->set_shape (WaveView::Rectified); @@ -1241,7 +1241,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/) default: wave->set_shape (WaveView::Normal); } - + wave->set_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic); vector v; @@ -1523,7 +1523,7 @@ AudioRegionView::set_some_waveform_colors (vector& wave } else { if (_region->muted()) { /* hide outline with zero alpha */ - outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0); + outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0); fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), MUTED_ALPHA); } else { outline = UIConfiguration::instance().color ("waveform outline"); diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index e82b5fc5ed..646d044c07 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -122,7 +122,7 @@ class AudioRegionView : public RegionView void redraw_end_xfade_to (boost::shared_ptr, framecnt_t, ArdourCanvas::Points&, double, double, double); void redraw_start_xfade (); void redraw_end_xfade (); - + void hide_xfades (); void hide_start_xfade (); void hide_end_xfade (); diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 91a9ee4cf6..d078de7a27 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -432,7 +432,7 @@ AudioStreamView::hide_xfades_with (boost::shared_ptr ar) { list start_hidden; list end_hidden; - + for (list::iterator i = region_views.begin(); i != region_views.end(); ++i) { AudioRegionView* const arv = dynamic_cast(*i); if (arv) { diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 6110673985..f59c4bc809 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -183,14 +183,14 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool AutomationTracks::iterator existing = _automation_tracks.find (param); if (existing != _automation_tracks.end()) { - + /* automation track created because we had existing data for * the processor, but visibility may need to be controlled * since it will have been set visible by default. */ existing->second->set_marked_for_display (show); - + if (!no_redraw) { request_redraw (); } @@ -219,7 +219,7 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool } else if (param.type() == MuteAutomation) { create_mute_automation_child (param, show); - + } else { error << "AudioTimeAxisView: unknown automation child " << EventTypeMap::instance().to_symbol(param) << endmsg; diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 8137fc4b19..d2a66a1027 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -94,7 +94,7 @@ AutomationLine::AutomationLine (const string& name, } else { _our_time_converter = true; } - + _visible = Line; update_pending = false; @@ -203,7 +203,7 @@ AutomationLine::hide () /* leave control points setting unchanged, we are just hiding the overall line */ - + set_visibility (AutomationLine::VisibleAspects (_visible & ~Line)); } @@ -582,10 +582,10 @@ AutomationLine::ContiguousControlPoints::clamp_dx (double dx) /* get the maximum distance we can move any of these points along the x-axis */ - + double tx; /* possible position a point would move to, given dx */ ControlPoint* cp; - + if (dx > 0) { /* check the last point, since we're moving later in time */ cp = back(); @@ -649,15 +649,15 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool no motion ever took place, but need to do before we handle motion. */ - + /* partition the points we are dragging into (potentially several) * set(s) of contiguous points. this will not happen with a normal * drag, but if the user does a discontiguous selection, it can. */ - + uint32_t expected_view_index = 0; CCP contig; - + for (list::iterator i = _drag_points.begin(); i != _drag_points.end(); ++i) { if (i == _drag_points.begin() || (*i)->view_index() != expected_view_index) { contig.reset (new ContiguousControlPoints (*this)); @@ -675,7 +675,7 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool (*ccp)->compute_x_bounds (trackview.editor()); } _drag_had_movement = true; - } + } /* OK, now on to the stuff related to *this* motion event. First, for * each contiguous range, figure out the maximum x-axis motion we are @@ -695,7 +695,7 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool } /* clamp y */ - + for (list::iterator i = _drag_points.begin(); i != _drag_points.end(); ++i) { double const y = ((_height - (*i)->get_y()) / _height) + dy; if (y < 0) { @@ -709,7 +709,7 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool if (dx || dy) { /* and now move each section */ - + for (vector::iterator ccp = contiguous_points.begin(); ccp != contiguous_points.end(); ++ccp) { (*ccp)->move (dx, dy); } @@ -731,7 +731,7 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool line->set_steps (line_points, is_stepped()); } } - + _drag_distance += dx; _drag_x += dx; _last_drag_fraction = fraction; @@ -884,7 +884,7 @@ AutomationLine::remove_point (ControlPoint& cp) XMLNode &before = alist->get_state(); alist->erase (cp.model()); - + trackview.editor().session()->add_command( new MementoCommand (memento_command_binder (), &before, &alist->get_state())); @@ -912,7 +912,7 @@ AutomationLine::get_selectables (framepos_t start, framepos_t end, double botfra /* model_when is relative to the start of the source, so we just need to add on the origin_b here (as it is the session frame position of the start of the source) */ - + framepos_t const session_frames_when = _time_converter->to (model_when) + _time_converter->origin_b (); if (session_frames_when >= start && session_frames_when <= end && (*i)->get_y() >= bot_track && (*i)->get_y() <= top_track) { @@ -993,7 +993,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events) np = events.size(); Evoral::ControlList& e = const_cast (events); - + for (AutomationList::iterator ai = e.begin(); ai != e.end(); ++ai, ++pi) { double tx = (*ai)->when; @@ -1008,17 +1008,17 @@ AutomationLine::reset_callback (const Evoral::ControlList& events) _name) << endmsg; continue; } - + if (tx >= max_framepos || tx < 0 || tx >= _maximum_time) { continue; } - + /* convert x-coordinate to a canvas unit coordinate (this takes * zoom and scroll into account). */ - + tx = trackview.editor().sample_to_pixel_unrounded (tx); - + /* convert from canonical view height (0..1.0) to actual * height coordinates (using X11's top-left rooted system) */ diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index 19399ec435..816cefedef 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -60,7 +60,7 @@ public: ControlPoints = 0x2, SelectedControlPoints = 0x4 }; - + AutomationLine (const std::string& name, TimeAxisView& tv, ArdourCanvas::Item& parent, diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 41ef49e9be..1c79593b34 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -110,7 +110,7 @@ AutomationTimeAxisView::AutomationTimeAxisView ( } tipname += nom; _name = tipname; - + CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main for auto %2/%1", _name, r->name())); CANVAS_DEBUG_NAME (selection_group, string_compose ("selections for auto %2/%1", _name, r->name())); CANVAS_DEBUG_NAME (_ghost_group, string_compose ("ghosts for auto %2/%1", _name, r->name())); @@ -178,7 +178,7 @@ AutomationTimeAxisView::AutomationTimeAxisView ( if (name_label.get_parent()) { name_label.get_parent()->remove (name_label); } - + name_label.set_text (_name); name_label.set_alignment (Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER); name_label.set_name (X_("TrackParameterName")); @@ -618,7 +618,7 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, } boost::shared_ptr list = _line->the_list (); - + if (list->in_write_pass()) { /* do not allow the GUI to add automation events during an automation write pass. @@ -781,11 +781,11 @@ AutomationTimeAxisView::add_line (boost::shared_ptr line) { if (_control && line) { assert(line->the_list() == _control->list()); - + _control->alist()->automation_state_changed.connect ( _list_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::automation_state_changed, this), gui_context() ); - + _control->alist()->InterpolationChanged.connect ( _list_connections, invalidator (*this), boost::bind (&AutomationTimeAxisView::interpolation_changed, this, _1), gui_context() ); @@ -860,15 +860,15 @@ AutomationTimeAxisView::what_has_visible_automation (const boost::shared_ptrcontrols()); - + for (Automatable::Controls::iterator i = controls.begin(); i != controls.end(); ++i) { - + boost::shared_ptr ac = boost::dynamic_pointer_cast (i->second); if (ac && ac->alist()) { - + const XMLNode* gui_node = ac->extra_xml ("GUI"); - + if (gui_node) { const XMLProperty* prop = gui_node->property ("shown"); if (prop) { diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index 5ff8f62292..b47ca98163 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -54,7 +54,7 @@ class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, pu virtual std::string name() const = 0; sigc::signal Hiding; - + void set_old_order_key (uint32_t ok) { _old_order_key = ok; } uint32_t old_order_key() const { return _old_order_key; } @@ -62,7 +62,7 @@ class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, pu /* for now, we always return properties in string form. */ std::string gui_property (const std::string& property_name) const; - + template void set_gui_property (const std::string& property_name, const T& value) { std::stringstream s; s << value; @@ -82,7 +82,7 @@ class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, pu static GUIObjectState& gui_object_state(); void clear_property_cache() { property_hashtable.clear(); } - + protected: AxisView (ARDOUR::Session* sess); diff --git a/gtk2_ardour/big_clock_window.h b/gtk2_ardour/big_clock_window.h index 1f723d1b59..a073bcc099 100644 --- a/gtk2_ardour/big_clock_window.h +++ b/gtk2_ardour/big_clock_window.h @@ -28,11 +28,11 @@ class BigClockWindow : public ArdourWindow { public: BigClockWindow (AudioClock&); - + private: AudioClock& clock; Gtk::Requisition default_size; - + void clock_size_reallocated (Gtk::Allocation&); void on_realize (); void on_unmap (); diff --git a/gtk2_ardour/bundle_env_cocoa.cc b/gtk2_ardour/bundle_env_cocoa.cc index 17d8075d38..418ca3636d 100644 --- a/gtk2_ardour/bundle_env_cocoa.cc +++ b/gtk2_ardour/bundle_env_cocoa.cc @@ -79,7 +79,7 @@ fixup_bundle_environment (int, char* [], string & localedir) localedir = "/this/cannot/exist"; } else { /* force localedir into the bundle */ - + vector lpath; lpath.push_back (bundle_dir); lpath.push_back ("Resources"); @@ -87,7 +87,7 @@ fixup_bundle_environment (int, char* [], string & localedir) localedir = Glib::build_filename (lpath).c_str(); } #endif - + export_search_path (bundle_dir, "ARDOUR_DLL_PATH", "/lib"); /* inside an OS X .app bundle, there is no difference diff --git a/gtk2_ardour/bundle_env_msvc.cc b/gtk2_ardour/bundle_env_msvc.cc index c119eb29bf..981553c179 100644 --- a/gtk2_ardour/bundle_env_msvc.cc +++ b/gtk2_ardour/bundle_env_msvc.cc @@ -86,7 +86,7 @@ std::string ret; if (0 == pExeRoot) { pExeRoot = g_build_filename("C:\\", "Program Files", PROGRAM_NAME, 0); } - + if (pExeRoot) { gchar tmp[PATH_MAX+1]; gchar* p; @@ -232,7 +232,7 @@ string fonts_conf_file; #ifdef DEBUG fonts_conf_file = get_module_folder(); - + if (!fonts_conf_file.empty()) { fonts_conf_file += "\\"; fonts_conf_file += PROGRAM_NAME; @@ -257,7 +257,7 @@ string pango_modules_file; #if defined(DEBUG) || defined(RDC_BUILD) // Make sure we pick up the debuggable DLLs !!! pango_modules_file = get_module_folder(); - + if (!pango_modules_file.empty()) { pango_modules_file += "\\"; pango_modules_file += PROGRAM_NAME; @@ -295,7 +295,7 @@ string gdk_pixbuf_loaders_file; #if defined(DEBUG) || defined(RDC_BUILD) // Make sure we pick up the debuggable DLLs !!! gdk_pixbuf_loaders_file = get_module_folder(); - + if (!gdk_pixbuf_loaders_file.empty()) { gdk_pixbuf_loaders_file += "\\"; gdk_pixbuf_loaders_file += PROGRAM_NAME; @@ -321,7 +321,7 @@ string clearlooks_la_file; #if defined(DEBUG) || defined(RDC_BUILD) // Make sure we pick up the debuggable DLLs !!! clearlooks_la_file = get_module_folder(); - + if (!clearlooks_la_file.empty()) { clearlooks_la_file += "\\"; clearlooks_la_file += PROGRAM_NAME; diff --git a/gtk2_ardour/button_joiner.cc b/gtk2_ardour/button_joiner.cc index bc2a0ae2f2..a3ef36ac80 100644 --- a/gtk2_ardour/button_joiner.cc +++ b/gtk2_ardour/button_joiner.cc @@ -78,7 +78,7 @@ ButtonJoiner::ButtonJoiner (const std::string& str, Gtk::Widget& lw, Gtk::Widget border_color = UIConfiguration::instance().color (string_compose ("%1: border end", name)); UINT_TO_RGBA (border_color, &r, &g, &b, &a); - + border_r = r/255.0; border_g = g/255.0; border_b = b/255.0; @@ -104,7 +104,7 @@ void ButtonJoiner::render (cairo_t* cr, cairo_rectangle_t*) { double h = get_height(); - + if (!get_active()) { cairo_set_source (cr, inactive_fill_pattern); } else { @@ -113,25 +113,25 @@ ButtonJoiner::render (cairo_t* cr, cairo_rectangle_t*) if (!central_link) { /* outer rect */ - + Gtkmm2ext::rounded_top_rectangle (cr, 0, 0, get_width(), h, 8); cairo_fill_preserve (cr); - + /* outer edge */ - + cairo_set_line_width (cr, 1.5); cairo_set_source_rgb (cr, border_r, border_g, border_b); cairo_stroke (cr); - + /* inner "edge" */ - + Gtkmm2ext::rounded_top_rectangle (cr, 8, 8, get_width() - 16, h - 8, 6); cairo_stroke (cr); } else { if (get_active()) { Gtkmm2ext::rounded_top_rectangle (cr, 0, 0, (get_width() - 20.0)/2.0 , h, 8); cairo_fill_preserve (cr); - + Gtkmm2ext::rounded_top_rectangle (cr, (get_width() - 20.)/2.0 + 20.0, 0.0, (get_width() - 20.0)/2.0 , h, 8); cairo_fill_preserve (cr); @@ -146,7 +146,7 @@ ButtonJoiner::render (cairo_t* cr, cairo_rectangle_t*) cairo_set_line_width (cr, 1.5); cairo_fill_preserve (cr); cairo_set_source_rgb (cr, border_r, border_g, border_b); - cairo_stroke (cr); + cairo_stroke (cr); } } } @@ -203,7 +203,7 @@ ButtonJoiner::action_sensitivity_changed () } else { set_visual_state (Gtkmm2ext::VisualState (visual_state() | Gtkmm2ext::Insensitive)); } - + } void @@ -231,7 +231,7 @@ ButtonJoiner::action_toggled () if (tact) { set_active (tact->get_active()); } -} +} void ButtonJoiner::set_active_state (Gtkmm2ext::ActiveState s) diff --git a/gtk2_ardour/button_joiner.h b/gtk2_ardour/button_joiner.h index 4716f7fda1..41e5f745c0 100644 --- a/gtk2_ardour/button_joiner.h +++ b/gtk2_ardour/button_joiner.h @@ -32,7 +32,7 @@ class ButtonJoiner : public CairoWidget, public Gtkmm2ext::Activatable { ButtonJoiner (const std::string&, Gtk::Widget&, Gtk::Widget&, bool central_link = false); ~ButtonJoiner (); - void set_related_action (Glib::RefPtr); + void set_related_action (Glib::RefPtr); void set_active_state (Gtkmm2ext::ActiveState); protected: diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index e9bdb4f1eb..bf7dad0429 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -1361,7 +1361,7 @@ gnome_canvas_waveview_gradient_render (GnomeCanvasItem *item, } else { PAINT_VERTA_GR(buf, waveview->wave_r, waveview->wave_g, waveview->wave_b, waveview->wave_a, x, pymax, fill_max, wave_middle, wave_top); } - + } if((prev_pymin > pymin && next_pymin > pymin) || @@ -1559,7 +1559,7 @@ gnome_canvas_waveview_gradient_render (GnomeCanvasItem *item, PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a >> 1, x - 1, pymax, pymax + (clip_length - 1)); } - if (clip_min) { + if (clip_min) { PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a , x, pymin - clip_length, pymin); PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a >> 1, x + 1, pymin - (clip_length - 1), pymin); PAINT_VERTA(buf, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a >> 1, x - 1, pymin - (clip_length - 1), pymin); diff --git a/gtk2_ardour/control_point.cc b/gtk2_ardour/control_point.cc index a044ccfb8f..b906e639d5 100644 --- a/gtk2_ardour/control_point.cc +++ b/gtk2_ardour/control_point.cc @@ -80,7 +80,7 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool /*dummy_arg_to_force ControlPoint::~ControlPoint () { CatchDeletion (this); /* EMIT SIGNAL */ - + delete _item; } diff --git a/gtk2_ardour/control_point.h b/gtk2_ardour/control_point.h index 045f1241ed..c9aab3af64 100644 --- a/gtk2_ardour/control_point.h +++ b/gtk2_ardour/control_point.h @@ -81,7 +81,7 @@ class ControlPoint : public Selectable AutomationLine& line() const { return _line; } static PBD::Signal1 CatchDeletion; - + private: ArdourCanvas::Rectangle* _item; AutomationLine& _line; diff --git a/gtk2_ardour/edit_note_dialog.cc b/gtk2_ardour/edit_note_dialog.cc index 0568468d63..ae154807a2 100644 --- a/gtk2_ardour/edit_note_dialog.cc +++ b/gtk2_ardour/edit_note_dialog.cc @@ -112,13 +112,13 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set n) _velocity_all.set_sensitive (false); _time_all.set_sensitive (false); _length_all.set_sensitive (false); - + int test_channel = (*_events.begin())->note()->channel (); int test_pitch = (*_events.begin())->note()->note (); int test_velocity = (*_events.begin())->note()->velocity (); Evoral::Beats test_time = (*_events.begin())->note()->time (); Evoral::Beats test_length = (*_events.begin())->note()->length (); - + for (set::iterator i = _events.begin(); i != _events.end(); ++i) { if ((*i)->note()->channel() != test_channel) { _channel_all.set_sensitive (true); @@ -140,7 +140,7 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set n) _length_all.set_sensitive (true); } } - + get_vbox()->pack_start (*table); add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 102b986e39..b5d6a55dd8 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -235,7 +235,7 @@ pane_size_watcher (Paned* pane) X: hard to access Quartz: impossible to access - + so stop that by preventing it from ever getting too narrow. 35 pixels is basically a rough guess at the tab width. @@ -313,7 +313,7 @@ Editor::Editor () PublicEditor::_instance = this; _have_idled = false; - + selection = new Selection (this); cut_buffer = new Selection (this); _selection_memento = new SelectionMemento (); @@ -742,7 +742,7 @@ Editor::Editor () signal_delete_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::exit_on_main_window_close)); Gtkmm2ext::Keyboard::the_keyboard().ZoomVerticalModifierReleased.connect (sigc::mem_fun (*this, &Editor::zoom_vertical_modifier_released)); - + /* allow external control surfaces/protocols to do various things */ ControlProtocol::ZoomToSession.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_session, this), gui_context()); @@ -1019,7 +1019,7 @@ Editor::control_select (uint32_t rid, Selection::Operation op) /* handles the (static) signal from the ControlProtocol class that * requests setting the selected track to a given RID */ - + if (!_session) { return; } @@ -1464,18 +1464,18 @@ Editor::fill_xfade_menu (Menu_Helpers::MenuList& items, bool start) sigc::bind (sigc::mem_fun (*this, emf), FadeLinear) ) ); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Constant power"), *(*images)[FadeConstantPower], sigc::bind (sigc::mem_fun (*this, emf), FadeConstantPower) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Symmetric"), @@ -1483,25 +1483,25 @@ Editor::fill_xfade_menu (Menu_Helpers::MenuList& items, bool start) sigc::bind (sigc::mem_fun (*this, emf), FadeSymmetric) ) ); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Slow"), *(*images)[FadeSlow], sigc::bind (sigc::mem_fun (*this, emf), FadeSlow) )); - + dynamic_cast(&items.back())->set_always_show_image (); - + items.push_back ( ImageMenuElem ( _("Fast"), *(*images)[FadeFast], sigc::bind (sigc::mem_fun (*this, emf), FadeFast) )); - + dynamic_cast(&items.back())->set_always_show_image (); } @@ -2101,7 +2101,7 @@ Editor::set_snap_to (SnapType st) case SnapToBeatDiv2: { ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin; ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end; - + compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), current_bbt_points_begin, current_bbt_points_end); compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_samples(), @@ -2587,9 +2587,9 @@ Editor::trackview_by_y_position (double y, bool trackview_relative_offset) const } for (TrackViewList::const_iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { - + std::pair const r = (*iter)->covers_y_position (y); - + if (r.first) { return r; } @@ -2948,7 +2948,7 @@ Editor::setup_toolbar () if (!ARDOUR::Profile->get_mixbus()) { mouse_mode_hbox->pack_start (mouse_cut_button, false, false); } - + if (!ARDOUR::Profile->get_trx()) { mouse_mode_hbox->pack_start (mouse_timefx_button, false, false); mouse_mode_hbox->pack_start (mouse_audition_button, false, false); @@ -3059,7 +3059,7 @@ Editor::setup_toolbar () if (!ARDOUR::Profile->get_trx()) { _zoom_tearoff = manage (new TearOff (_zoom_box)); - + _zoom_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast(&toolbar_hbox), &_zoom_tearoff->tearoff_window())); _zoom_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast (&toolbar_hbox), @@ -3169,7 +3169,7 @@ void Editor::build_edit_mode_menu () { using namespace Menu_Helpers; - + edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Slide], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Slide))); // edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Splice], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Splice))); edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_strings[(int)Ripple], sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Ripple))); @@ -3400,11 +3400,11 @@ Editor::commit_reversible_selection_op () The user has undone some selection ops and then made a new one, making anything earlier in the list invalid. */ - + list::iterator it = selection_op_history.begin(); list::iterator e_it = it; advance (e_it, selection_op_history_it); - + for ( ; it != e_it; ++it) { delete *it; } @@ -3764,7 +3764,7 @@ Editor::set_zoom_preset (int64_t ms) temporal_zoom_session(); return; } - + ARDOUR::framecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate(); temporal_zoom( (sample_rate * ms / 1000) / _visible_canvas_width ); } @@ -3779,7 +3779,7 @@ Editor::set_visible_track_count (int32_t n) allocation happens, we will get called again and then we can do the real work. */ - + if (_visible_canvas_height <= 1) { return; } @@ -3787,7 +3787,7 @@ Editor::set_visible_track_count (int32_t n) int h; string str; DisplaySuspender ds; - + if (_visible_track_count > 0) { h = trackviews_height() / _visible_track_count; std::ostringstream s; @@ -3813,7 +3813,7 @@ Editor::set_visible_track_count (int32_t n) for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { (*i)->set_height (h, TimeAxisView::HeightPerLane); } - + if (str != visible_tracks_selector.get_text()) { visible_tracks_selector.set_text (str); } @@ -3995,7 +3995,7 @@ Editor::set_show_measures (bool yn) ARDOUR::TempoMap::BBTPointList::const_iterator begin; ARDOUR::TempoMap::BBTPointList::const_iterator end; - + compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), begin, end); draw_measures (begin, end); } @@ -4329,7 +4329,7 @@ Editor::copy_playlists (TimeAxisView* v) void Editor::clear_playlists (TimeAxisView* v) { - begin_reversible_command (_("clear playlists")); + begin_reversible_command (_("clear playlists")); vector > playlists; _session->playlists->get (playlists); mapover_tracks (sigc::mem_fun (*this, &Editor::mapped_clear_playlist), v, ARDOUR::Properties::select.property_id); @@ -4434,7 +4434,7 @@ Editor::current_visual_state (bool with_tracks) vs->leftmost_frame = leftmost_frame; vs->zoom_focus = zoom_focus; - if (with_tracks) { + if (with_tracks) { *vs->gui_state = *ARDOUR_UI::instance()->gui_object_state; } @@ -4498,11 +4498,11 @@ Editor::use_visual_state (VisualState& vs) set_zoom_focus (vs.zoom_focus); reposition_and_zoom (vs.leftmost_frame, vs.samples_per_pixel); - + if (vs.gui_state) { *ARDOUR_UI::instance()->gui_object_state = *vs.gui_state; - - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { + + for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { (*i)->clear_property_cache(); (*i)->reset_visual_state (); } @@ -4612,7 +4612,7 @@ Editor::idle_visual_changer () pending_visual_change.idle_handler_id = -1; pending_visual_change.being_handled = true; - + VisualChange vc = pending_visual_change; pending_visual_change.pending = (VisualChange::Type) 0; @@ -4636,7 +4636,7 @@ Editor::visual_changer (const VisualChange& vc) ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin; ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end; - + compute_current_bbt_points (vc.time_origin, pending_visual_change.time_origin + current_page_samples(), current_bbt_points_begin, current_bbt_points_end); compute_bbt_ruler_scale (vc.time_origin, pending_visual_change.time_origin + current_page_samples(), @@ -4978,17 +4978,17 @@ Editor::get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) cons { for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) { RouteTimeAxisView* rtav; - + if ((rtav = dynamic_cast (*i)) != 0) { boost::shared_ptr pl; std::vector > results; boost::shared_ptr tr; - + if ((tr = rtav->track()) == 0) { /* bus */ continue; } - + if ((pl = (tr->playlist())) != 0) { boost::shared_ptr r = pl->region_by_id (id); if (r) { @@ -5014,7 +5014,7 @@ Editor::get_per_region_note_selection (listget_per_region_note_selection (selection); } } - + } void @@ -5070,7 +5070,7 @@ void Editor::first_idle () { MessageDialog* dialog = 0; - + if (track_views.size() > 1) { dialog = new MessageDialog ( *this, @@ -5606,7 +5606,7 @@ Editor::reset_x_origin_to_follow_playhead () } else { framepos_t l = 0; - + if (frame < leftmost_frame) { /* moving left */ if (_session->transport_rolling()) { @@ -5630,7 +5630,7 @@ Editor::reset_x_origin_to_follow_playhead () if (l < 0) { l = 0; } - + center_screen_internal (l + (current_page_samples() / 2), current_page_samples ()); } } @@ -5775,7 +5775,7 @@ Editor::session_going_away () clear_marker_display (); stop_step_editing (); - + /* get rid of any existing editor mixer strip */ WindowTitle title(Glib::get_application_name()); @@ -5851,7 +5851,7 @@ Editor::setup_fade_images () _fade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut"))); _fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut"))); _fade_out_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-constant-power"))); - + _xfade_in_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadein-linear"))); _xfade_in_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadein-symmetric"))); _xfade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadein-fast-cut"))); @@ -5922,10 +5922,10 @@ void Editor::popup_control_point_context_menu (ArdourCanvas::Item* item, GdkEvent* event) { using namespace Menu_Helpers; - + MenuList& items = _control_point_context_menu.items (); items.clear (); - + items.push_back (MenuElem (_("Edit..."), sigc::bind (sigc::mem_fun (*this, &Editor::edit_control_point), item))); items.push_back (MenuElem (_("Delete"), sigc::bind (sigc::mem_fun (*this, &Editor::remove_control_point), item))); if (!can_remove_control_point (item)) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index c1e9fc3218..013f82d8b2 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -263,7 +263,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_selected_regionview_from_region_list (boost::shared_ptr region, Selection::Operation op = Selection::Set); void remove_tracks (); - + /* tempo */ void set_show_measures (bool yn); @@ -366,7 +366,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void scroll_tracks_down_line (); void scroll_tracks_up_line (); - + bool scroll_up_one_track (bool skip_child_views = false); bool scroll_down_one_track (bool skip_child_views = false); @@ -503,7 +503,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD TimeAxisView* stepping_axis_view () { return _stepping_axis_view; } - + void set_stepping_axis_view (TimeAxisView* v) { _stepping_axis_view = v; } @@ -530,7 +530,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void split_regions_at (framepos_t, RegionSelection&); void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false); RegionSelection get_regions_from_selection_and_mouse (framepos_t); - + void mouse_add_new_tempo_event (framepos_t where); void mouse_add_new_meter_event (framepos_t where); void edit_tempo_section (ARDOUR::TempoSection*); @@ -719,7 +719,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector > const &); void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector > const &); void mapped_clear_playlist (RouteTimeAxisView&, uint32_t); - + void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type); bool button_release_can_deselect; bool _mouse_changed_selection; @@ -2258,7 +2258,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD QuantizeDialog* quantize_dialog; MainMenuDisabler* _main_menu_disabler; - + friend class Drag; friend class RegionDrag; friend class RegionMoveDrag; diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 5ac93a3339..388d4fd34d 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -460,7 +460,7 @@ Editor::register_actions () Glib::RefPtr mouse_mode_actions = ActionGroup::create (X_("MouseMode")); RadioAction::Group mouse_mode_group; - act = ActionManager::register_toggle_action (mouse_mode_actions, "set-mouse-mode-object-range", _("Smart Object Mode"), sigc::mem_fun (*this, &Editor::mouse_mode_object_range_toggled)); + act = ActionManager::register_toggle_action (mouse_mode_actions, "set-mouse-mode-object-range", _("Smart Object Mode"), sigc::mem_fun (*this, &Editor::mouse_mode_object_range_toggled)); smart_mode_action = Glib::RefPtr::cast_static (act); smart_mode_button.set_related_action (smart_mode_action); smart_mode_button.set_text (_("Smart")); @@ -471,27 +471,27 @@ Editor::register_actions () mouse_move_button.set_icon (Gtkmm2ext::ArdourIcon::ToolGrab); mouse_move_button.set_name ("mouse mode button"); - act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-range", _("Range Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange)); + act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-range", _("Range Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange)); mouse_select_button.set_related_action (act); mouse_select_button.set_icon (Gtkmm2ext::ArdourIcon::ToolRange); mouse_select_button.set_name ("mouse mode button"); - act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-draw", _("Note Drawing Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseDraw)); + act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-draw", _("Note Drawing Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseDraw)); mouse_draw_button.set_related_action (act); mouse_draw_button.set_icon (Gtkmm2ext::ArdourIcon::ToolDraw); mouse_draw_button.set_name ("mouse mode button"); - act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-audition", _("Audition Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseAudition)); + act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-audition", _("Audition Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseAudition)); mouse_audition_button.set_related_action (act); mouse_audition_button.set_icon (Gtkmm2ext::ArdourIcon::ToolAudition); mouse_audition_button.set_name ("mouse mode button"); - act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("Time FX Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseTimeFX)); + act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("Time FX Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseTimeFX)); mouse_timefx_button.set_related_action (act); mouse_timefx_button.set_icon (Gtkmm2ext::ArdourIcon::ToolStretch); mouse_timefx_button.set_name ("mouse mode button"); - act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-content", _("Content Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseContent)); + act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-content", _("Content Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseContent)); mouse_content_button.set_related_action (act); mouse_content_button.set_icon (Gtkmm2ext::ArdourIcon::ToolContent); mouse_content_button.set_name ("mouse mode button"); @@ -502,7 +502,7 @@ Editor::register_actions () mouse_cut_button.set_icon (Gtkmm2ext::ArdourIcon::ToolCut); mouse_cut_button.set_name ("mouse mode button"); } - + ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), sigc::bind (sigc::mem_fun(*this, &Editor::step_mouse_mode), true)); RadioAction::Group edit_point_group; @@ -601,7 +601,7 @@ Editor::register_actions () /* set defaults here */ no_ruler_shown_update = true; - + if (Profile->get_trx()) { ruler_marker_action->set_active (true); ruler_meter_action->set_active (false); @@ -613,7 +613,7 @@ Editor::register_actions () ruler_cd_marker_action->set_active (false); ruler_timecode_action->set_active (false); ruler_minsec_action->set_active (true); - } else { + } else { ruler_marker_action->set_active (true); ruler_meter_action->set_active (true); ruler_tempo_action->set_active (true); @@ -741,7 +741,7 @@ void Editor::load_bindings () { /* XXX move this to a better place */ - + key_bindings.set_action_map (editor_action_map); std::string binding_file; @@ -1632,7 +1632,7 @@ void Editor::toggle_sound_midi_notes () { Glib::RefPtr act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes")); - + if (act) { bool s = UIConfiguration::instance().get_sound_midi_notes(); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 13fd6fe8b9..36c9e34102 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -128,7 +128,7 @@ Editor::initialize_canvas () _trackview_group = new ArdourCanvas::Container (hv_scroll_group); CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews"); - + // used as rubberband rect rubberband_rect = new ArdourCanvas::Rectangle (hv_scroll_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, 0.0)); rubberband_rect->hide(); @@ -140,7 +140,7 @@ Editor::initialize_canvas () CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion"); /* TIME BAR CANVAS */ - + _time_markers_group = new ArdourCanvas::Container (h_scroll_group); CANVAS_DEBUG_NAME (_time_markers_group, "time bars"); @@ -187,7 +187,7 @@ Editor::initialize_canvas () cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM); ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height)); - + cd_marker_bar_drag_rect = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, 0.0, 100, timebar_height)); CANVAS_DEBUG_NAME (cd_marker_bar_drag_rect, "cd marker drag"); cd_marker_bar_drag_rect->set_outline (false); @@ -401,7 +401,7 @@ void Editor::drop_paths_part_two (const vector& paths, framepos_t frame, double ypos, bool copy) { RouteTimeAxisView* tv; - + /* MIDI files must always be imported, because we consider them * writable. So split paths into two vectors, and follow the import * path on the MIDI part. @@ -427,7 +427,7 @@ Editor::drop_paths_part_two (const vector& paths, framepos_t frame, doub frame = 0; InstrumentSelector is; // instantiation builds instrument-list and sets default. do_import (midi_paths, Editing::ImportDistinctFiles, ImportAsTrack, SrcBest, frame, is.selected_instrument()); - + if (Profile->get_sae() || UIConfiguration::instance().get_only_copy_imported_files() || copy) { do_import (audio_paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame); } else { @@ -520,13 +520,13 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers) if (from_headers) { alloc = controls_layout.get_allocation (); - } else { + } else { alloc = _track_canvas_viewport->get_allocation (); /* reduce height by the height of the timebars, which happens to correspond to the position of the hv_scroll_group. */ - + alloc.set_height (alloc.get_height() - hv_scroll_group->position().y); alloc.set_y (alloc.get_y() + hv_scroll_group->position().y); @@ -539,21 +539,21 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers) /* the effective width of the autoscroll boundary so that we start scrolling before we hit the edge. - + this helps when the window is slammed up against the right edge of the screen, making it hard to scroll effectively. */ - + if (alloc.get_width() > 20) { alloc.set_width (alloc.get_width() - 20); alloc.set_x (alloc.get_x() + 10); } } - + scrolling_boundary = ArdourCanvas::Rect (alloc.get_x(), alloc.get_y(), alloc.get_x() + alloc.get_width(), alloc.get_y() + alloc.get_height()); - + int x, y; Gdk::ModifierType mask; @@ -607,7 +607,7 @@ Editor::autoscroll_canvas () no_stop = true; } else if (x < autoscroll_boundary.x0) { - + dx = autoscroll_boundary.x0 - x; dx += 10 + (2 * (autoscroll_cnt/2)); @@ -621,7 +621,7 @@ Editor::autoscroll_canvas () no_stop = true; } - + if (new_frame != leftmost_frame) { vc.time_origin = new_frame; vc.add (VisualChange::TimeOrigin); @@ -629,12 +629,12 @@ Editor::autoscroll_canvas () } if (autoscroll_vertical_allowed) { - + // const double vertical_pos = vertical_adjustment.get_value(); const int speed_factor = 10; /* vertical */ - + if (y < autoscroll_boundary.y0) { /* scroll to make higher tracks visible */ @@ -671,7 +671,7 @@ Editor::autoscroll_canvas () ev.type = GDK_MOTION_NOTIFY; ev.state = Gdk::BUTTON1_MASK; - + /* the motion handler expects events in canvas coordinate space */ /* we asked for the mouse position above (::get_pointer()) via @@ -700,7 +700,7 @@ Editor::autoscroll_canvas () ev.y = d.y; motion_handler (0, (GdkEvent*) &ev, true); - + } else if (no_stop) { /* not changing visual state but pointer is outside the scrolling boundary @@ -711,7 +711,7 @@ Editor::autoscroll_canvas () ev.type = GDK_MOTION_NOTIFY; ev.state = Gdk::BUTTON1_MASK; - + /* the motion handler expects events in canvas coordinate space */ /* first convert from Editor window coordinates to canvas @@ -740,7 +740,7 @@ Editor::autoscroll_canvas () ev.y = d.y; motion_handler (0, (GdkEvent*) &ev, true); - + } else { stop_canvas_autoscroll (); return false; @@ -749,7 +749,7 @@ Editor::autoscroll_canvas () autoscroll_cnt++; return true; /* call me again */ -} +} void Editor::start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary) @@ -895,7 +895,7 @@ Editor::color_handler() samples_ruler->set_outline_color (text); bbt_ruler->set_fill_color (base); bbt_ruler->set_outline_color (text); - + playhead_cursor->set_color (UIConfiguration::instance().color ("play head")); meter_bar->set_fill_color (UIConfiguration::instance().color_mod ("meter bar", "marker bar")); @@ -1082,9 +1082,9 @@ Editor::which_trim_cursor (bool left) const } Trimmable::CanTrim ct = entered_regionview->region()->can_trim (); - + if (left) { - + if (ct & Trimmable::FrontTrimEarlier) { return _cursors->left_side_trim; } else { @@ -1112,7 +1112,7 @@ Editor::which_mode_cursor () const case MouseCut: mode_cursor = _cursors->scissors; break; - + case MouseObject: case MouseContent: /* don't use mode cursor, pick a grabber cursor based on the item */ @@ -1138,20 +1138,20 @@ Editor::which_mode_cursor () const get_pointer_position (x, y); if (x >= 0 && y >= 0) { - + vector items; /* Note how we choose a specific scroll group to get * items from. This could be problematic. */ - + hv_scroll_group->add_items_at_point (ArdourCanvas::Duple (x,y), items); - + // first item will be the upper most - + if (!items.empty()) { const ArdourCanvas::Item* i = items.front(); - + if (i && i->parent() && i->parent()->get_data (X_("timeselection"))) { pair tvp = trackview_by_y_position (_last_motion_y); if (dynamic_cast (tvp.first)) { @@ -1200,7 +1200,7 @@ Editor::which_canvas_cursor(ItemType type) const break; } } - + if ((mouse_mode == MouseObject || get_smart_mode ()) || mouse_mode == MouseContent) { @@ -1296,7 +1296,7 @@ Editor::which_canvas_cursor(ItemType type) const } } else if (mouse_mode == MouseDraw) { - + /* ControlPointItem is not really specific to region gain mode but it is the same cursor so don't worry about this for now. The result is that we'll see the fader cursor if we enter diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 2527a1597c..5a8abad6f1 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -67,7 +67,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) if (Keyboard::some_magic_widget_has_focus()) { return false; } - + framepos_t xdelta; int direction = ev->direction; @@ -329,7 +329,7 @@ Editor::canvas_wave_view_event (GdkEvent *event, ArdourCanvas::Item* item, Regio } return ret; -} +} bool @@ -1036,7 +1036,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType bool handled = false; if (event->type == GDK_SCROLL) { - + /* scroll events in the rulers are handled a little differently from scrolling elsewhere in the canvas. */ @@ -1055,7 +1055,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType } handled = true; break; - + case GDK_SCROLL_DOWN: if (Profile->get_mixbus()) { //for mouse-wheel zoom, force zoom-focus to mouse @@ -1068,7 +1068,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType } handled = true; break; - + case GDK_SCROLL_LEFT: xdelta = (current_page_samples() / 2); if (leftmost_frame > xdelta) { @@ -1078,7 +1078,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType } handled = true; break; - + case GDK_SCROLL_RIGHT: xdelta = (current_page_samples() / 2); if (max_framepos - xdelta > leftmost_frame) { @@ -1088,7 +1088,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType } handled = true; break; - + default: /* what? */ break; @@ -1130,9 +1130,9 @@ Editor::canvas_note_event (GdkEvent *event, ArdourCanvas::Item* item) bool Editor::canvas_drop_zone_event (GdkEvent* event) { - GdkEventScroll scroll; + GdkEventScroll scroll; ArdourCanvas::Duple winpos; - + switch (event->type) { case GDK_BUTTON_RELEASE: if (event->button.button == 1) { @@ -1193,18 +1193,18 @@ Editor::track_canvas_drag_motion (Glib::RefPtr const& context, std::pair const tv = trackview_by_y_position (py, false); bool can_drop = false; - + if (tv.first != 0) { /* over a time axis view of some kind */ rtav = dynamic_cast (tv.first); - + if (rtav != 0 && rtav->is_track ()) { /* over a track, not a bus */ can_drop = true; } - + } else { /* not over a time axis view, so drop is possible */ @@ -1213,7 +1213,7 @@ Editor::track_canvas_drag_motion (Glib::RefPtr const& context, if (can_drop) { region = _regions->get_dragged_region (); - + if (region) { if (tv.first == 0 @@ -1227,17 +1227,17 @@ Editor::track_canvas_drag_motion (Glib::RefPtr const& context, context->drag_status (context->get_suggested_action(), time); return true; } - + if ((boost::dynamic_pointer_cast (region) != 0 && dynamic_cast (tv.first) != 0) || (boost::dynamic_pointer_cast (region) != 0 && dynamic_cast (tv.first) != 0)) { - + /* audio to audio OR midi to midi */ - + context->drag_status (context->get_suggested_action(), time); return true; } diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index 9cabbce56b..40245778d5 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -49,7 +49,7 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour _track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX); _track_canvas_item->set_x (0); - + _current_frame = 1; /* force redraw at 0 */ } @@ -63,7 +63,7 @@ EditorCursor::EditorCursor (Editor& ed) _track_canvas_item->set_show_head (1, false); _track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX); _track_canvas_item->set_ignore_events (true); - + _track_canvas_item->set_x (0); _current_frame = 1; /* force redraw at 0 */ diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h index d7e856c9e5..f841f0c778 100644 --- a/gtk2_ardour/editor_cursors.h +++ b/gtk2_ardour/editor_cursors.h @@ -50,7 +50,7 @@ class EditorCursor { PBD::Signal1 PositionChanged; - private: + private: Editor& _editor; ArdourCanvas::Arrow* _track_canvas_item; framepos_t _current_frame; diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 376cebfd49..d5466a1ed5 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4969,7 +4969,7 @@ SelectionDrag::finished (GdkEvent* event, bool movement_occurred) s->clear_range_selection (); } } - + } else { /* just a click, no pointer movement. */ diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index b4d5994a63..2d4ad30668 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -202,7 +202,7 @@ public: bool initially_vertical() const { return _initially_vertical; } - + /** Set up the _pointer_frame_offset */ virtual void setup_pointer_frame_offset () { _pointer_frame_offset = 0; @@ -582,7 +582,7 @@ public: private: double y_to_region (double) const; ARDOUR::framecnt_t grid_frames (framepos_t) const; - + MidiRegionView* _region_view; ArdourCanvas::Rectangle* _drag_rect; framepos_t _note[2]; @@ -675,7 +675,7 @@ public: private: Operation _operation; - + bool _preserve_fade_anchor; bool _jump_position_when_done; }; @@ -932,7 +932,7 @@ public: * @param drag_in_progress true if the drag is currently happening. */ virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0; - + virtual void deselect_things () = 0; protected: @@ -1042,7 +1042,7 @@ public: RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation); ~RangeMarkerBarDrag (); - + void start_grab (GdkEvent *, Gdk::Cursor* c = 0); void motion (GdkEvent *, bool); void finished (GdkEvent *, bool); @@ -1134,7 +1134,7 @@ class CrossfadeEdgeDrag : public Drag void motion (GdkEvent*, bool); void finished (GdkEvent*, bool); void aborted (bool); - + bool y_movement_matters () const { return false; } diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc index 0d1f055c80..15592035e5 100644 --- a/gtk2_ardour/editor_export_audio.cc +++ b/gtk2_ardour/editor_export_audio.cc @@ -114,16 +114,16 @@ Editor::export_region () boost::shared_ptr r = selection->regions.front()->region(); boost::shared_ptr audio_region = boost::dynamic_pointer_cast(r); boost::shared_ptr midi_region = boost::dynamic_pointer_cast(r); - + if (audio_region) { - + RouteTimeAxisView & rtv (dynamic_cast (selection->regions.front()->get_time_axis_view())); AudioTrack & track (dynamic_cast (*rtv.route())); - + ExportRegionDialog dialog (*this, *(audio_region.get()), track); dialog.set_session (_session); dialog.run (); - + } else if (midi_region) { MidiExportDialog dialog (*this, midi_region); @@ -146,13 +146,13 @@ Editor::export_region () true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); - + checker.set_title (_("File Exists!")); checker.add_button (Stock::CANCEL, RESPONSE_CANCEL); checker.add_button (_("Overwrite Existing File"), RESPONSE_ACCEPT); checker.set_default_response (RESPONSE_CANCEL); - + checker.set_wmclass (X_("midi_export_file_exists"), PROGRAM_NAME); checker.set_position (Gtk::WIN_POS_MOUSE); @@ -169,7 +169,7 @@ Editor::export_region () default: return; } - + } (void) midi_region->clone (path); diff --git a/gtk2_ardour/editor_group_tabs.cc b/gtk2_ardour/editor_group_tabs.cc index a4043b7a19..48fe9e231d 100644 --- a/gtk2_ardour/editor_group_tabs.cc +++ b/gtk2_ardour/editor_group_tabs.cc @@ -91,7 +91,7 @@ EditorGroupTabs::draw_tab (cairo_t* cr, Tab const & tab) const { double const arc_radius = get_width(); double r, g, b, a; - + if (tab.group && tab.group->is_active()) { ArdourCanvas::color_to_rgba (tab.color, r, g, b, a); } else { diff --git a/gtk2_ardour/editor_keys.cc b/gtk2_ardour/editor_keys.cc index 2548a68ab4..a2ee357436 100644 --- a/gtk2_ardour/editor_keys.cc +++ b/gtk2_ardour/editor_keys.cc @@ -45,7 +45,7 @@ Editor::keyboard_selection_finish (bool /*add*/) framepos_t start = selection->time.start(); framepos_t end; - + if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) { end = _session->audible_frame(); } else { @@ -54,7 +54,7 @@ Editor::keyboard_selection_finish (bool /*add*/) //snap the selection start/end snap_to(start); - + //if no tracks are selected and we're working from the keyboard, enable all tracks (_something_ has to be selected for any range selection) if ( (_edit_point == EditAtPlayhead) && selection->tracks.empty() ) select_all_tracks(); @@ -81,19 +81,19 @@ Editor::keyboard_selection_begin () } else { start = get_preferred_edit_position(); } - + //snap the selection start/end snap_to(start); - + //if there's not already a sensible selection endpoint, go "forever" if ( start > end ) { end = max_framepos; } - + //if no tracks are selected and we're working from the keyboard, enable all tracks (_something_ has to be selected for any range selection) if ( selection->tracks.empty() ) select_all_tracks(); - + selection->set (start, end); //if session is playing a range, cancel that diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index a8663edf6f..201631e8c5 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -68,7 +68,7 @@ Editor::add_new_location (Location *location) /* Do a full update of the markers in this group */ update_marker_labels (group); - + if (location->is_auto_punch()) { update_punch_range_view (); } @@ -965,7 +965,7 @@ Editor::build_range_marker_menu (bool loop_or_punch, bool session) if (!loop_or_punch_or_session || !session) { items.push_back (SeparatorElem()); } - + items.push_back (MenuElem (_("Separate Regions in Range"), sigc::mem_fun(*this, &Editor::marker_menu_separate_regions_using_location))); items.push_back (MenuElem (_("Select All in Range"), sigc::mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range))); if (!Profile->get_sae()) { @@ -1216,7 +1216,7 @@ Editor::marker_menu_set_from_selection (bool /*force_regions*/) // nothing for now } else { - + if (!selection->time.empty()) { l->set (selection->time.start(), selection->time.end_frame()); } else if (!selection->regions.empty()) { @@ -1295,7 +1295,7 @@ Editor::marker_menu_zoom_to_range () if (a >= extra) { a -= extra; } - + framepos_t b = l->end (); if (b < (max_framepos - extra)) { b += extra; @@ -1480,7 +1480,7 @@ Editor::update_loop_range_view () transport_loop_range_rect->set_x1 (x2); transport_loop_range_rect->show(); - + } else { transport_loop_range_rect->hide(); } @@ -1499,7 +1499,7 @@ Editor::update_punch_range_view () double pixel_start; double pixel_end; - + if (_session->config.get_punch_in()) { pixel_start = sample_to_pixel (tpl->start()); } else { @@ -1510,9 +1510,9 @@ Editor::update_punch_range_view () } else { pixel_end = sample_to_pixel (max_framepos); } - + transport_punch_range_rect->set_x0 (pixel_start); - transport_punch_range_rect->set_x1 (pixel_end); + transport_punch_range_rect->set_x1 (pixel_end); transport_punch_range_rect->show(); } else { diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 5871b5709a..9769d616fe 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -80,7 +80,7 @@ Editor::show_editor_mixer (bool yn) if (yn) { Glib::RefPtr win = get_window (); Glib::RefPtr screen; - + if (win) { screen = win->get_screen(); } else { @@ -184,7 +184,7 @@ Editor::create_editor_mixer () current_mixer_strip->WidthChanged.connect (sigc::mem_fun(*this, &Editor::ensure_all_elements_drawn)); #endif current_mixer_strip->set_embedded (true); - + } void diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 18478cdaac..094afc2692 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -207,7 +207,7 @@ void Editor::mouse_mode_object_range_toggled() { MouseMode m = mouse_mode; - + Glib::RefPtr act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range")); assert (act); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); @@ -313,7 +313,7 @@ Editor::mouse_mode_toggled (MouseMode m) } set_gain_envelope_visibility (); - + update_time_selection_display (); update_all_enter_cursors (); @@ -1229,17 +1229,17 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case TempoMarkerItem: { ArdourMarker* marker; TempoMarker* tempo_marker; - + if ((marker = reinterpret_cast (item->get_data ("marker"))) == 0) { fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg; abort(); /*NOTREACHED*/ } - + if ((tempo_marker = dynamic_cast (marker)) == 0) { fatal << _("programming error: marker for tempo is not a tempo marker!") << endmsg; abort(); /*NOTREACHED*/ } - + edit_tempo_marker (*tempo_marker); break; } @@ -1247,12 +1247,12 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case MeterMarkerItem: { ArdourMarker* marker; MeterMarker* meter_marker; - + if ((marker = reinterpret_cast (item->get_data ("marker"))) == 0) { fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg; abort(); /*NOTREACHED*/ } - + if ((meter_marker = dynamic_cast (marker)) == 0) { fatal << _("programming error: marker for meter is not a meter marker!") << endmsg; abort(); /*NOTREACHED*/ @@ -1320,7 +1320,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case SelectionItem: popup_track_context_menu (1, event->button.time, item_type, true); break; - + case AutomationTrackItem: popup_track_context_menu (1, event->button.time, item_type, false); break; @@ -1549,7 +1549,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT case MouseDraw: return true; - + case MouseRange: // x_style_paste (where, 1.0); return true; @@ -1880,14 +1880,14 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from current_stepping_trackview = 0; step_timeout.disconnect (); } - + if (_session && _session->actively_recording()) { /* Sorry. no dragging stuff around while we record */ return true; } - + update_join_object_range_location (event->motion.y); - + if (_drags->active ()) { return _drags->motion_handler (event, from_autoscroll); } @@ -2064,7 +2064,7 @@ Editor::cancel_time_selection () } selection->time.clear (); clicked_selection = 0; -} +} void Editor::point_trim (GdkEvent* event, framepos_t new_bound) @@ -2386,7 +2386,7 @@ Editor::update_join_object_range_location (double y) } else if (entered_track) { RouteTimeAxisView* entered_route_view = dynamic_cast (entered_track); - + if (entered_route_view) { double cx = 0; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 1ce3915131..e8174ce9e6 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -119,7 +119,7 @@ Editor::undo (uint32_t n) if (_drags->active ()) { _drags->abort (); } - + if (_session) { _session->undo (n); if (_session->undo_depth() == 0) { @@ -136,7 +136,7 @@ Editor::redo (uint32_t n) if (_drags->active ()) { _drags->abort (); } - + if (_session) { _session->redo (n); if (_session->redo_depth() == 0) { @@ -237,7 +237,7 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions) for (list::iterator i = used_trackviews.begin(); i != used_trackviews.end(); ++i) { region_added_connections.push_back ((*i)->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view))); } - + while (used_playlists.size() > 0) { list >::iterator i = used_playlists.begin(); (*i)->thaw(); @@ -713,7 +713,7 @@ Editor::build_region_boundary_cache () TimeAxisView *ontrack = 0; TrackViewList tlist; - + if (!selection->tracks.empty()) { tlist = selection->tracks.filter_to_unique_playlists (); } else { @@ -1487,21 +1487,21 @@ Editor::scroll_down_one_track (bool skip_child_views) } /* move to the track below the first one that covers the */ - + if (next != track_views.rend()) { ensure_time_axis_view_is_visible (**next, true); return true; } return false; -} +} bool Editor::scroll_up_one_track (bool skip_child_views) { TrackViewList::iterator prev = track_views.end(); double top_of_trackviews = vertical_adjustment.get_value (); - + for (TrackViewList::iterator t = track_views.begin(); t != track_views.end(); ++t) { if ((*t)->hidden()) { @@ -1513,7 +1513,7 @@ Editor::scroll_up_one_track (bool skip_child_views) * Note that covers_y_position() is recursive and includes child views */ std::pair res = (*t)->covers_y_position (top_of_trackviews); - + if (res.first) { if (skip_child_views) { break; @@ -1562,7 +1562,7 @@ Editor::scroll_up_one_track (bool skip_child_views) prev = t; } - + if (prev != track_views.end()) { // move to bottom-most automation-lane of the previous track TimeAxisView::Children kids = (*prev)->get_child_list(); @@ -1601,7 +1601,7 @@ Editor::tav_zoom_step (bool coarser) } else { ts = &selection->tracks; } - + for (TrackViewList::iterator i = ts->begin(); i != ts->end(); ++i) { TimeAxisView *tv = (static_cast(*i)); tv->step_height (coarser); @@ -1620,7 +1620,7 @@ Editor::tav_zoom_smooth (bool coarser, bool force_all) } else { ts = &selection->tracks; } - + for (TrackViewList::iterator i = ts->begin(); i != ts->end(); ++i) { TimeAxisView *tv = (static_cast(*i)); uint32_t h = tv->current_height (); @@ -1825,7 +1825,7 @@ Editor::temporal_zoom_region (bool both_axes) if ( !get_selection_extents(start, end) ) return; - + calc_extra_zoom_edges (start, end); /* if we're zooming on both axes we need to save track heights etc. @@ -1836,7 +1836,7 @@ Editor::temporal_zoom_region (bool both_axes) PBD::Unwinder nsv (no_save_visual, true); temporal_zoom_by_frame (start, end); - + if (both_axes) { uint32_t per_track_height = (uint32_t) floor ((_visible_canvas_height - 10.0) / tracks.size()); @@ -1869,7 +1869,7 @@ Editor::get_selection_extents ( framepos_t &start, framepos_t &end ) start = max_framepos; end = 0; bool ret = true; - + //ToDo: if notes are selected, set extents to that selection //ToDo: if control points are selected, set extents to that selection @@ -1898,8 +1898,8 @@ Editor::get_selection_extents ( framepos_t &start, framepos_t &end ) if ((start == 0 && end == 0) || end < start) { ret = false; } - - return ret; + + return ret; } @@ -1924,7 +1924,7 @@ Editor::temporal_zoom_selection (bool both_axes) calc_extra_zoom_edges(start, end); temporal_zoom_by_frame (start, end); } - + if (both_axes) fit_selection(); } @@ -1974,7 +1974,7 @@ Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end) framepos_t range = end - start; const framecnt_t new_fpp = (framecnt_t) ceil ((double) range / (double) _visible_canvas_width); - + framepos_t new_page = range; framepos_t middle = (framepos_t) floor ((double) start + ((double) range / 2.0f)); framepos_t new_leftmost = (framepos_t) floor ((double) middle - ((double) new_page / 2.0f)); @@ -2027,7 +2027,7 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame) /* zoom focus is automatically taken as @param frame when this method is used. */ - + framepos_t new_leftmost = frame - (framepos_t)range_before; if (new_leftmost > frame) { @@ -2098,12 +2098,12 @@ Editor::add_location_from_selection () Location *location = new Location (*_session, start, end, rangename, Location::IsRangeMarker); begin_reversible_command (_("add marker")); - + XMLNode &before = _session->locations()->get_state(); _session->locations()->add (location, true); XMLNode &after = _session->locations()->get_state(); _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); - + commit_reversible_command (); } @@ -2120,12 +2120,12 @@ Editor::add_location_mark (framepos_t where) } Location *location = new Location (*_session, where, where, markername, Location::IsMark); begin_reversible_command (_("add marker")); - + XMLNode &before = _session->locations()->get_state(); _session->locations()->add (location, true); XMLNode &after = _session->locations()->get_state(); _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); - + commit_reversible_command (); } @@ -2134,7 +2134,7 @@ Editor::set_session_start_from_playhead () { if (!_session) return; - + Location* loc; if ((loc = _session->locations()->session_range_location()) == 0) { //should never happen _session->set_session_extents ( _session->audible_frame(), _session->audible_frame() ); @@ -2146,7 +2146,7 @@ Editor::set_session_start_from_playhead () XMLNode &after = loc->get_state(); begin_reversible_command (_("Set session start")); - + _session->add_command (new MementoCommand(*loc, &before, &after)); commit_reversible_command (); @@ -2158,7 +2158,7 @@ Editor::set_session_end_from_playhead () { if (!_session) return; - + Location* loc; if ((loc = _session->locations()->session_range_location()) == 0) { //should never happen _session->set_session_extents ( _session->audible_frame(), _session->audible_frame() ); @@ -2200,7 +2200,7 @@ Editor::remove_location_at_playhead_cursor () removed = true; } } - + //store undo if (removed) { begin_reversible_command (_("remove marker")); @@ -2221,7 +2221,7 @@ Editor::add_locations_from_region () return; } bool commit = false; - + XMLNode &before = _session->locations()->get_state(); for (RegionSelection::iterator i = rs.begin (); i != rs.end (); ++i) { @@ -2292,7 +2292,7 @@ Editor::jump_forward_to_mark () if (pos < 0) { return; } - + _session->request_locate (pos, _session->transport_rolling()); } @@ -2332,12 +2332,12 @@ Editor::clear_markers () { if (_session) { begin_reversible_command (_("clear markers")); - + XMLNode &before = _session->locations()->get_state(); _session->locations()->clear_markers (); XMLNode &after = _session->locations()->get_state(); _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); - + commit_reversible_command (); } } @@ -2347,14 +2347,14 @@ Editor::clear_ranges () { if (_session) { begin_reversible_command (_("clear ranges")); - + XMLNode &before = _session->locations()->get_state(); _session->locations()->clear_ranges (); XMLNode &after = _session->locations()->get_state(); _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); - + commit_reversible_command (); } } @@ -2363,12 +2363,12 @@ void Editor::clear_locations () { begin_reversible_command (_("clear locations")); - + XMLNode &before = _session->locations()->get_state(); _session->locations()->clear (); XMLNode &after = _session->locations()->get_state(); _session->add_command(new MementoCommand(*(_session->locations()), &before, &after)); - + commit_reversible_command (); } @@ -2541,11 +2541,11 @@ Editor::maybe_locate_with_edit_preroll ( framepos_t location ) return; location -= get_preroll(); - + //don't try to locate before the beginning of time if ( location < 0 ) location = 0; - + //if follow_playhead is on, keep the playhead on the screen if ( _follow_playhead ) if ( location < leftmost_frame ) @@ -2559,16 +2559,16 @@ Editor::play_with_preroll () { { framepos_t preroll = get_preroll(); - + framepos_t start, end; if (!get_selection_extents ( start, end)) return; if (start > preroll) start = start - preroll; - + end = end + preroll; //"post-roll" - + AudioRange ar (start, end, 0); list lar; lar.push_back (ar); @@ -2629,7 +2629,7 @@ Editor::do_layer_operation (LayerOperation op) begin_reversible_command (_("raise region to top")); } break; - + case Lower: if (multiple) { begin_reversible_command (_("lower regions")); @@ -2637,7 +2637,7 @@ Editor::do_layer_operation (LayerOperation op) begin_reversible_command (_("lower region")); } break; - + case LowerToBottom: if (multiple) { begin_reversible_command (_("lower regions to bottom")); @@ -2651,7 +2651,7 @@ Editor::do_layer_operation (LayerOperation op) for (set >::iterator i = playlists.begin(); i != playlists.end(); ++i) { (*i)->clear_owned_changes (); } - + for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) { boost::shared_ptr r = (*i)->region (); switch (op) { @@ -2674,7 +2674,7 @@ Editor::do_layer_operation (LayerOperation op) (*i)->rdiff (cmds); _session->add_commands (cmds); } - + commit_reversible_command (); } @@ -3870,7 +3870,7 @@ Editor::freeze_route () /* stop transport before we start. this is important */ _session->request_transport_speed (0.0); - + /* wait for just a little while, because the above call is asynchronous */ Glib::usleep (250000); @@ -4125,15 +4125,15 @@ Editor::cut_copy (CutCopyOp op) if (!selection->regions.empty()) { cut_copy_regions (op, selection->regions); - + if (op == Cut || op == Delete) { selection->clear_regions (); } } - + if (!selection->points.empty()) { cut_copy_points (op); - + if (op == Cut || op == Delete) { selection->clear_points (); } @@ -4151,19 +4151,19 @@ Editor::cut_copy (CutCopyOp op) did_edit = true; cut_copy_ranges (op); - + if (op == Cut || op == Delete) { selection->clear_time (); } } - + if (did_edit) { /* reset repeated paste state */ paste_count = 0; last_paste_pos = 0; - commit_reversible_command (); + commit_reversible_command (); } - + if (op == Delete || op == Cut || op == Clear) { _drags->abort (); } @@ -4172,7 +4172,7 @@ Editor::cut_copy (CutCopyOp op) struct AutomationRecord { AutomationRecord () : state (0) , line(NULL) {} AutomationRecord (XMLNode* s, const AutomationLine* l) : state (s) , line (l) {} - + XMLNode* state; ///< state before any operation const AutomationLine* line; ///< line this came from boost::shared_ptr copy; ///< copied events for the cut buffer @@ -4258,10 +4258,10 @@ Editor::cut_copy_points (Editing::CutCopyOp op, Evoral::Beats earliest, bool mid cut_buffer->add (i->second.copy); } } - + if (op == Delete || op == Cut) { /* This operation needs to remove things from the main AutomationList, so do that now */ - + for (Lists::iterator i = lists.begin(); i != lists.end(); ++i) { i->first->freeze (); } @@ -4346,7 +4346,7 @@ Editor::remove_clicked_region () vector cmds; playlist->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command(new StatefulDiffCommand (playlist)); commit_reversible_command (); } @@ -4421,7 +4421,7 @@ Editor::remove_selected_regions () vector cmds; (*pl)->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command(new StatefulDiffCommand (*pl)); } @@ -4513,15 +4513,15 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) if (op != Delete) { vector::iterator z; - + for (z = pmap.begin(); z != pmap.end(); ++z) { if ((*z).tv == &tv) { break; } } - + assert (z != pmap.end()); - + if (!(*z).pl) { npl = PlaylistFactory::create (pl->data_type(), *_session, "cutlist", true); npl->freeze(); @@ -4542,7 +4542,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) if (Config->get_edit_mode() == Ripple) pl->ripple (r->position(), -r->length(), boost::shared_ptr()); break; - + case Cut: _xx = RegionFactory::create (r); npl->add_region (_xx, r->position() - first_position); @@ -4569,20 +4569,20 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) if (op != Delete) { list > foo; - + /* the pmap is in the same order as the tracks in which selected regions occured */ - + for (vector::iterator i = pmap.begin(); i != pmap.end(); ++i) { if ((*i).pl) { (*i).pl->thaw(); foo.push_back ((*i).pl); } } - + if (!foo.empty()) { cut_buffer->set (foo); } - + if (pmap.empty()) { _last_cut_copy_source_track = 0; } else { @@ -4599,7 +4599,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) vector cmds; (*pl)->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command (new StatefulDiffCommand (*pl)); } } @@ -5452,7 +5452,7 @@ Editor::apply_filter (Filter& filter, string command, ProgressReporter* progress vector cmds; playlist->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command(new StatefulDiffCommand (playlist)); } @@ -5486,7 +5486,7 @@ Editor::reset_region_gain_envelopes () } bool in_command = false; - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { AudioRegionView* const arv = dynamic_cast(*i); if (arv) { @@ -5580,13 +5580,13 @@ Editor::toggle_region_lock () } begin_reversible_command (_("toggle region lock")); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); (*i)->region()->set_locked (!(*i)->region()->locked()); _session->add_command (new StatefulDiffCommand ((*i)->region())); } - + commit_reversible_command (); } @@ -5604,13 +5604,13 @@ Editor::toggle_region_video_lock () } begin_reversible_command (_("Toggle Video Lock")); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); (*i)->region()->set_video_locked (!(*i)->region()->video_locked()); _session->add_command (new StatefulDiffCommand ((*i)->region())); } - + commit_reversible_command (); } @@ -5628,14 +5628,14 @@ Editor::toggle_region_lock_style () } begin_reversible_command (_("region lock style")); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); PositionLockStyle const ns = (*i)->region()->position_lock_style() == AudioTime ? MusicTime : AudioTime; (*i)->region()->set_position_lock_style (ns); _session->add_command (new StatefulDiffCommand ((*i)->region())); } - + commit_reversible_command (); } @@ -5653,13 +5653,13 @@ Editor::toggle_opaque_region () } begin_reversible_command (_("change region opacity")); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { (*i)->region()->clear_changes (); (*i)->region()->set_opaque (!(*i)->region()->opaque()); _session->add_command (new StatefulDiffCommand ((*i)->region())); } - + commit_reversible_command (); } @@ -5977,7 +5977,7 @@ Editor::toggle_region_fades (int dir) if (_ignore_region_action) { return; } - + boost::shared_ptr ar; bool yn = false; @@ -6117,7 +6117,7 @@ Editor::split_region () //if no range was selected, try to find some regions to split if (current_mouse_mode() == MouseObject) { //don't try this for Internal Edit, Stretch, Draw, etc. - + RegionSelection rs = get_regions_from_selection_and_edit_point (); framepos_t where = get_preferred_edit_position (); @@ -6252,7 +6252,7 @@ Editor::set_session_extents_from_selection () if (_session == 0) { return; } - + framepos_t start, end; if (!get_selection_extents ( start, end)) return; @@ -6282,27 +6282,27 @@ Editor::set_punch_start_from_edit_point () framepos_t start = 0; framepos_t end = max_framepos; - + //use the existing punch end, if any Location* tpl = transport_punch_location(); if (tpl) { end = tpl->end(); } - + if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) { start = _session->audible_frame(); } else { start = get_preferred_edit_position(); } - + //snap the selection start/end snap_to(start); - + //if there's not already a sensible selection endpoint, go "forever" if ( start > end ) { end = max_framepos; } - + set_punch_range (start, end, _("set punch start from EP")); } @@ -6315,13 +6315,13 @@ Editor::set_punch_end_from_edit_point () framepos_t start = 0; framepos_t end = max_framepos; - + //use the existing punch start, if any Location* tpl = transport_punch_location(); if (tpl) { start = tpl->start(); } - + if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) { end = _session->audible_frame(); } else { @@ -6330,7 +6330,7 @@ Editor::set_punch_end_from_edit_point () //snap the selection start/end snap_to(end); - + set_punch_range (start, end, _("set punch end from EP")); } @@ -6343,22 +6343,22 @@ Editor::set_loop_start_from_edit_point () framepos_t start = 0; framepos_t end = max_framepos; - + //use the existing loop end, if any Location* tpl = transport_loop_location(); if (tpl) { end = tpl->end(); } - + if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) { start = _session->audible_frame(); } else { start = get_preferred_edit_position(); } - + //snap the selection start/end snap_to(start); - + //if there's not already a sensible selection endpoint, go "forever" if ( start > end ) { end = max_framepos; @@ -6376,13 +6376,13 @@ Editor::set_loop_end_from_edit_point () framepos_t start = 0; framepos_t end = max_framepos; - + //use the existing loop start, if any Location* tpl = transport_loop_location(); if (tpl) { start = tpl->start(); } - + if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) { end = _session->audible_frame(); } else { @@ -6391,7 +6391,7 @@ Editor::set_loop_end_from_edit_point () //snap the selection start/end snap_to(end); - + set_loop_range (start, end, _("set loop end from EP")); } } @@ -6574,7 +6574,7 @@ Editor::split_region_at_transients () } begin_reversible_command (_("split regions")); - + for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ) { RegionSelection::iterator tmp; @@ -6591,7 +6591,7 @@ Editor::split_region_at_transients () i = tmp; } - + commit_reversible_command (); } @@ -6754,7 +6754,7 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList vector cmds; pl->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command (new StatefulDiffCommand (pl)); if (select_new) { @@ -6781,12 +6781,12 @@ Editor::place_transient() framepos_t where = get_preferred_edit_position(); begin_reversible_command (_("place transient")); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { framepos_t position = (*r)->region()->position(); (*r)->region()->add_transient(where - position); } - + commit_reversible_command (); } @@ -6816,7 +6816,7 @@ Editor::snap_regions_to_grid () } begin_reversible_command (_("snap regions to grid")); - + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { boost::shared_ptr pl = (*r)->region()->playlist(); @@ -6839,7 +6839,7 @@ Editor::snap_regions_to_grid () (*i)->thaw(); used_playlists.pop_front(); } - + commit_reversible_command (); } @@ -6899,7 +6899,7 @@ Editor::close_region_gaps () /* Iterate over the region list and make adjacent regions overlap by crossfade_len_ms */ begin_reversible_command (_("close region gaps")); - + int idx = 0; boost::shared_ptr last_region; @@ -6938,7 +6938,7 @@ Editor::close_region_gaps () (*i)->thaw(); used_playlists.pop_front(); } - + commit_reversible_command (); } @@ -7028,7 +7028,7 @@ Editor::playhead_forward_to_grid () if (!_session) { return; } - + framepos_t pos = playhead_cursor->current_frame (); if (pos < max_framepos - 1) { pos += 2; @@ -7044,7 +7044,7 @@ Editor::playhead_backward_to_grid () if (!_session) { return; } - + framepos_t pos = playhead_cursor->current_frame (); if (pos > 2) { pos -= 2; @@ -7163,7 +7163,7 @@ edit your ardour.rc file to set the\n\ trackstr = P_("track", "tracks", ntracks); busstr = P_("bus", "busses", nbusses); - + if (ntracks) { if (nbusses) { prompt = string_compose (_("Do you really want to remove %1 %2 and %3 %4?\n" @@ -7282,7 +7282,7 @@ Editor::insert_time ( pl.insert ((*x)->playlist ()); } } - + for (set >::iterator i = pl.begin(); i != pl.end(); ++i) { (*i)->clear_changes (); @@ -7388,7 +7388,7 @@ Editor::do_remove_time () if (response != RESPONSE_OK) { return; } - + framecnt_t distance = d.distance(); if (distance == 0) { @@ -7420,26 +7420,26 @@ Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, for (TrackSelection::iterator x = selection->tracks.begin(); x != selection->tracks.end(); ++x) { /* regions */ boost::shared_ptr pl = (*x)->playlist(); - + if (pl) { XMLNode &before = pl->get_state(); - + std::list rl; AudioRange ar(pos, pos+frames, 0); rl.push_back(ar); pl->cut (rl); pl->shift (pos, -frames, true, ignore_music_glue); - + if (!in_command) { begin_reversible_command (_("cut time")); in_command = true; } XMLNode &after = pl->get_state(); - + _session->add_command (new MementoCommand (*pl, &before, &after)); } - + /* automation */ RouteTimeAxisView* rtav = dynamic_cast (*x); if (rtav) { @@ -7452,7 +7452,7 @@ Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, } std::list loc_kill_list; - + /* markers */ if (markers_too) { bool moved = false; @@ -7514,7 +7514,7 @@ Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, for (list::iterator i = loc_kill_list.begin(); i != loc_kill_list.end(); ++i) { _session->locations()->remove( *i ); } - + if (moved) { if (!in_command) { begin_reversible_command (_("cut time")); @@ -7524,7 +7524,7 @@ Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, _session->add_command (new MementoCommand(*_session->locations(), &before, &after)); } } - + if (tempo_too) { XMLNode& before (_session->tempo_map().get_state()); @@ -7537,7 +7537,7 @@ Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, _session->add_command (new MementoCommand(_session->tempo_map(), &before, &after)); } } - + if (in_command) { commit_reversible_command (); } @@ -7701,7 +7701,7 @@ void Editor::start_visual_state_op (uint32_t n) { save_visual_state (n); - + PopUp* pup = new PopUp (WIN_POS_MOUSE, 1000, true); char buf[32]; snprintf (buf, sizeof (buf), _("Saved view %u"), n+1); @@ -7835,7 +7835,7 @@ Editor::toggle_midi_input_active (bool flip_others) onoff = !mt->input_active(); } } - + _session->set_exclusive_input_active (rl, onoff, flip_others); } @@ -7853,14 +7853,14 @@ Editor::lock () b->set_text (_("Click to unlock")); b->signal_clicked.connect (sigc::mem_fun (*this, &Editor::unlock)); lock_dialog->get_vbox()->pack_start (*b); - + lock_dialog->get_vbox()->show_all (); lock_dialog->set_size_request (200, 200); } delete _main_menu_disabler; _main_menu_disabler = new MainMenuDisabler; - + lock_dialog->present (); } @@ -7868,7 +7868,7 @@ void Editor::unlock () { lock_dialog->hide (); - + delete _main_menu_disabler; if (UIConfiguration::instance().get_lock_gui_after_seconds()) { @@ -7900,11 +7900,11 @@ Editor::bring_all_sources_into_session () ArdourDialog w (_("Moving embedded files into session folder")); w.get_vbox()->pack_start (msg); w.present (); - + /* flush all pending GUI events because we're about to start copying * files */ - + Gtkmm2ext::UI::instance()->flush_pending (); cerr << " Do it\n"; diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 5b143acc75..31e7bf1309 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -124,7 +124,7 @@ EditorRegions::EditorRegions (Editor* e) { 10, S_("Opaque|O"), _("Region opaque (blocks regions below it from being heard)?") }, { -1, 0, 0 } }; - + for (int i = 0; ci[i].index >= 0; ++i) { col = _display.get_column (ci[i].index); l = manage (new Label (ci[i].label)); @@ -433,7 +433,7 @@ EditorRegions::add_region (boost::shared_ptr region) */ row = *(_model->insert (subrows.end())); - + } else { row = *(_model->append()); } @@ -569,7 +569,7 @@ EditorRegions::selection_changed () _change_connection.block (false); } } - + } } else { _editor->get_selection().clear_regions (); diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index d66c6b6794..041cef8892 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -75,7 +75,7 @@ EditorRouteGroups::EditorRouteGroups (Editor* e) TreeViewColumn* color_column = manage (new TreeViewColumn ("", *color_renderer)); color_column->add_attribute (color_renderer->property_color(), _columns.gdkcolor); - + _display.append_column (*color_column); _display.append_column ("", _columns.text); @@ -138,7 +138,7 @@ EditorRouteGroups::EditorRouteGroups (Editor* e) CellRendererText* name_cell = dynamic_cast(_display.get_column_cell_renderer (1)); name_cell->property_editable() = true; name_cell->signal_edited().connect (sigc::mem_fun (*this, &EditorRouteGroups::name_edit)); - + for (int i = 1; ci[i].index >= 0; ++i) { CellRendererToggle* active_cell = dynamic_cast (_display.get_column_cell_renderer (i)); @@ -274,10 +274,10 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev) c = color_dialog.get_colorsel()->get_current_color(); GroupTabs::set_group_color (group, gdk_color_to_rgba (c)); break; - + default: break; - + } color_dialog.hide (); @@ -301,7 +301,7 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev) ret = true; break; - + case 3: val = (*iter)[_columns.active_state]; group->set_active (!val, this); @@ -423,11 +423,11 @@ EditorRouteGroups::add (RouteGroup* group) row[_columns.active_shared] = group->is_route_active (); row[_columns.active_state] = group->is_active (); row[_columns.is_visible] = !group->is_hidden(); - + Gdk::Color c; set_color_from_rgba (c, GroupTabs::group_color (group)); row[_columns.gdkcolor] = c; - + _in_row_change = true; row[_columns.routegroup] = group; @@ -505,7 +505,7 @@ EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange&) break; } } - + _in_row_change = false; for (TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) { diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index d79039db09..a10f523800 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -525,7 +525,7 @@ EditorRoutes::redisplay_real () } bool visible = tv->marked_for_display (); - + /* show or hide the TimeAxisView */ if (visible) { position += tv->show_at (position, n, &_editor->edit_controls_vbox); @@ -886,11 +886,11 @@ EditorRoutes::reset_remote_control_ids () for (ri = rows.begin(); ri != rows.end(); ++ri) { /* skip two special values */ - + if (rid == Route::MasterBusRemoteControlID) { rid++; } - + if (rid == Route::MonitorBusRemoteControlID) { rid++; } @@ -1414,7 +1414,7 @@ EditorRoutes::initial_display () } RouteList r (*_session->get_routes()); - + r.sort (EditorOrderRouteSorter ()); _editor->add_routes (r); } @@ -1602,7 +1602,7 @@ EditorRoutes::idle_update_mute_rec_solo_etc() (*i)[_columns.active] = route->active (); if (boost::dynamic_pointer_cast (route)) { boost::shared_ptr mt = boost::dynamic_pointer_cast (route); - + if (route->record_enabled()) { if (_session->record_status() == Session::Recording) { (*i)[_columns.rec_state] = 1; @@ -1614,7 +1614,7 @@ EditorRoutes::idle_update_mute_rec_solo_etc() } else { (*i)[_columns.rec_state] = 0; } - + (*i)[_columns.name_editable] = !route->record_enabled (); } } diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index f4ce487654..ccd03995ff 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -130,7 +130,7 @@ Editor::initialize_rulers () _bbt_metric = new BBTMetric (this); _minsec_metric = new MinsecMetric (this); _samples_metric = new SamplesMetric (this); - + timecode_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_timecode_metric, ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height)); timecode_ruler->set_font_description (font); @@ -175,7 +175,7 @@ Editor::initialize_rulers () minsec_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), minsec_ruler, MinsecRulerItem)); bbt_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), bbt_ruler, BBTRulerItem)); samples_ruler->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_event), samples_ruler, SamplesRulerItem)); - + visible_timebars = 0; /*this will be changed below */ } @@ -1141,7 +1141,7 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper, } else { bbt_ruler_scale = bbt_show_ticks_detail; } - + if ((bbt_ruler_scale == bbt_show_ticks_detail) && (lower_beat.beats == upper_beat.beats) && (upper_beat.ticks - lower_beat.ticks <= Timecode::BBT_Time::ticks_per_beat / 4)) { bbt_ruler_scale = bbt_show_ticks_super_detail; } @@ -1154,7 +1154,7 @@ edit_last_mark_label (std::vector& marks, const std:: copy.label = newlabel; marks.pop_back (); marks.push_back (copy); -} +} void Editor::metric_get_bbt (std::vector& marks, gdouble lower, gdouble upper, gint /*maxchars*/) @@ -1234,7 +1234,7 @@ Editor::metric_get_bbt (std::vector& marks, gdouble l bbt_nmarks = (beats + 2) * bbt_beat_subdivision; bbt_position_of_helper = lower + (30 * Editor::get_current_zoom ()); - + // could do marks.assign() here to preallocate mark.label = ""; diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 41de4f38f2..5a59b48a90 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -461,7 +461,7 @@ Editor::mapover_tracks_with_unique_playlists (sigc::slot (*i); if (v && v->route()->route_group() == group) { - + boost::shared_ptr t = v->track(); if (t) { if (playlists.insert (t->playlist()).second) { @@ -1005,7 +1005,7 @@ Editor::track_selection_changed () ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, !selection->tracks.empty()); /* notify control protocols */ - + ControlProtocol::TrackSelectionChanged (routes); if (sfbrowser && _session && !_session->deletion_in_progress()) { @@ -1341,7 +1341,7 @@ Editor::sensitize_the_right_region_actions () if (have_active_fade_out && have_inactive_fade_out) { // a->set_inconsistent (); } - + bool const have_active_fade = have_active_fade_in || have_active_fade_out; bool const have_inactive_fade = have_inactive_fade_in || have_inactive_fade_out; @@ -1351,7 +1351,7 @@ Editor::sensitize_the_right_region_actions () if (have_active_fade && have_inactive_fade) { // a->set_inconsistent (); } - + _ignore_region_action = false; _all_region_actions_sensitized = false; @@ -1610,7 +1610,7 @@ Editor::set_selection_from_region () /* find all the tracks that have selected regions */ set tracks; - + for (RegionSelection::const_iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { tracks.insert (&(*r)->get_time_axis_view()); } @@ -1623,9 +1623,9 @@ Editor::set_selection_from_region () selection->set (selection->regions.start(), selection->regions.end_frame()); /* and select the tracks */ - + selection->set (tvl); - + if (!Profile->get_sae()) { set_mouse_mode (Editing::MouseRange, false); } @@ -1946,7 +1946,7 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const end = 0; return false; } - + // if (!mouse_frame (m, ignored)) { // /* mouse is not in a canvas, try playhead+selected marker. // this is probably most true when using menus. diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index a516c80c9f..baf1e4970a 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -223,7 +223,7 @@ EditorSummary::render (cairo_t* cr, cairo_rectangle_t*) } cairo_push_group (cr); - + /* Fill with the background image */ cairo_rectangle (cr, 0, 0, get_width(), get_height()); @@ -408,7 +408,7 @@ bool EditorSummary::on_button_press_event (GdkEventButton* ev) { _old_follow_playhead = _editor->follow_playhead (); - + if (ev->button == 1) { pair xr; @@ -436,7 +436,7 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) get_editor (&_pending_editor_x, &_pending_editor_y); _pending_editor_changed = false; } - + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { /* secondary-modifier-click: locate playhead */ @@ -489,7 +489,7 @@ EditorSummary::get_editor (pair* x, pair* y) con /* We are dragging, and configured not to update the editor window during drags, so just return where the editor will be when the drag finishes. */ - + *x = _pending_editor_x; *y = _pending_editor_y; @@ -499,7 +499,7 @@ EditorSummary::get_editor (pair* x, pair* y) con x->first = (_editor->leftmost_sample () - _start) * _x_scale; x->second = x->first + _editor->current_page_samples() * _x_scale; - + y->first = editor_y_to_summary (_editor->vertical_adjustment.get_value ()); y->second = editor_y_to_summary (_editor->vertical_adjustment.get_value () + _editor->visible_canvas_height() - _editor->get_trackview_group()->canvas_origin().y); } @@ -668,7 +668,7 @@ bool EditorSummary::on_button_release_event (GdkEventButton*) { bool const was_suspended = suspending_editor_updates (); - + _move_dragging = false; _zoom_dragging = false; _editor->_dragging_playhead = false; @@ -677,7 +677,7 @@ EditorSummary::on_button_release_event (GdkEventButton*) if (was_suspended && _pending_editor_changed) { set_editor (_pending_editor_x, _pending_editor_y); } - + return true; } @@ -767,7 +767,7 @@ EditorSummary::set_editor (double const x, double const y) as it also means that we won't change these variables if an idle handler is merely pending but not executing. But c'est la vie. */ - + return; } @@ -854,12 +854,12 @@ EditorSummary::set_editor_x (pair x) set_dirty (); } else { _editor->reset_x_origin (x.first / _x_scale + _start); - + double const nx = ( ((x.second - x.first) / _x_scale) / _editor->sample_to_pixel (_editor->current_page_samples()) ); - + if (nx != _editor->get_current_zoom ()) { _editor->reset_zoom (nx); } diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 90c64d2b1b..38685e5dd6 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -133,12 +133,12 @@ Editor::redisplay_tempo (bool immediate_redraw) if (immediate_redraw) { ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin; ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end; - + compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), current_bbt_points_begin, current_bbt_points_end); draw_measures (current_bbt_points_begin, current_bbt_points_end); update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end); // redraw rulers and measures - + } else { Glib::signal_idle().connect (sigc::bind_return (sigc::bind (sigc::mem_fun (*this, &Editor::redisplay_tempo), true), false)); } diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index 5908e50249..d78340df65 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -161,7 +161,7 @@ Editor::time_fx (RegionList& regions, float val, bool pitching) do_timefx (); return 0; } - + switch (current_timefx->run ()) { case RESPONSE_ACCEPT: break; diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 654f63a8cd..61dbe22a78 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -566,7 +566,7 @@ EngineControl::build_full_control_notebook () basic_packer.attach (input_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0); ++row; } - + output_channels.set_name ("OutputChannels"); output_channels.set_flags (Gtk::CAN_FOCUS); output_channels.set_digits (0); @@ -579,7 +579,7 @@ EngineControl::build_full_control_notebook () basic_packer.attach (output_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0); ++row; } - + input_latency.set_name ("InputLatency"); input_latency.set_flags (Gtk::CAN_FOCUS); input_latency.set_digits (0); @@ -1023,7 +1023,7 @@ EngineControl::print_channel_count (Gtk::SpinButton* sb) if (ARDOUR::Profile->get_mixbus()) { return true; } - + uint32_t cnt = (uint32_t) sb->get_value(); if (cnt == 0) { sb->set_text (_("all available channels")); @@ -1433,7 +1433,7 @@ EngineControl::device_changed () queue_device_changed = true; } } - + //the device name must be set FIRST so ASIO can populate buffersizes and the control panel button if (backend->use_separate_input_and_output_devices()) { backend->set_input_device_name (device_name_in); diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 10b0ea8851..8d9c6ff24b 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -158,7 +158,7 @@ ExportDialog::init_gui () export_notebook.append_page (*file_format_selector, _("File format")); export_notebook.append_page (*timespan_selector, _("Time Span")); export_notebook.append_page (*channel_selector, _("Channels")); - + get_vbox()->pack_start (export_notebook, true, true, 0); get_vbox()->pack_end (warning_widget, false, false, 0); get_vbox()->pack_end (progress_widget, false, false, 0); @@ -325,7 +325,7 @@ ExportDialog::show_progress () if (!status->aborted()) { NagScreen* ns = NagScreen::maybe_nag (_("export")); - + if (ns) { ns->nag (); delete ns; diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc index ae924c10e3..2469e4f6cc 100644 --- a/gtk2_ardour/export_file_notebook.cc +++ b/gtk2_ardour/export_file_notebook.cc @@ -301,7 +301,7 @@ ExportFileNotebook::FilePage::update_example_filename() example = profile_manager->get_sample_filename_for_format ( filename_state->filename, format_state->format); } - + if (example != "") { filename_selector.set_example_filename(Glib::path_get_basename (example)); } else { diff --git a/gtk2_ardour/export_filename_selector.cc b/gtk2_ardour/export_filename_selector.cc index 93f7daf832..831b75ef02 100644 --- a/gtk2_ardour/export_filename_selector.cc +++ b/gtk2_ardour/export_filename_selector.cc @@ -328,10 +328,10 @@ ExportFilenameSelector::open_browse_dialog () while (true) { int result = dialog.run(); - + if (result == Gtk::RESPONSE_OK) { std::string filename = dialog.get_filename(); - + if (!Glib::file_test (filename, Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) { Gtk::MessageDialog msg (string_compose (_("%1: this is only the directory/folder name, not the filename.\n\ The filename will be chosen from the information just above the folder selector."), filename)); diff --git a/gtk2_ardour/export_format_dialog.h b/gtk2_ardour/export_format_dialog.h index 6a25d707bf..6197d0d7be 100644 --- a/gtk2_ardour/export_format_dialog.h +++ b/gtk2_ardour/export_format_dialog.h @@ -180,7 +180,7 @@ class ExportFormatDialog : public ArdourDialog, public PBD::ScopedConnectionList AudioClock silence_end_clock; /* Post-export hook */ - + Gtk::Label command_label; Gtk::Entry command_entry; diff --git a/gtk2_ardour/export_timespan_selector.cc b/gtk2_ardour/export_timespan_selector.cc index 0c6ff08cf9..83f8a8f4aa 100644 --- a/gtk2_ardour/export_timespan_selector.cc +++ b/gtk2_ardour/export_timespan_selector.cc @@ -55,7 +55,7 @@ ExportTimespanSelector::ExportTimespanSelector (ARDOUR::Session * session, Profi ) ); option_hbox.pack_start (*b, false, false, 6); - + b = Gtk::manage (new Gtk::Button (_("Deselect All"))); b->signal_clicked().connect ( sigc::bind ( diff --git a/gtk2_ardour/floating_text_entry.cc b/gtk2_ardour/floating_text_entry.cc index 9907360c01..d264ee930b 100644 --- a/gtk2_ardour/floating_text_entry.cc +++ b/gtk2_ardour/floating_text_entry.cc @@ -34,7 +34,7 @@ FloatingTextEntry::FloatingTextEntry (const std::string& initial_contents) set_name (X_("FloatingTextEntry")); set_position (Gtk::WIN_POS_MOUSE); set_border_width (0); - + if (!initial_contents.empty()) { entry.set_text (initial_contents); } diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 9e1edbb520..4a7e75fcf7 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -133,7 +133,7 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int max_peak = minus_infinity(); peak_display.set_text (_("-inf")); peak_display.set_alignment(0.5); - + /* stuff related to the fact that the peak display is not, in fact, supposed to be a text entry. */ @@ -282,7 +282,7 @@ GainMeterBase::setup_gain_adjustment () ignore_toggle = false; effective_gain_display (); - + _previous_amp_output_streams = _amp->output_streams (); } @@ -529,7 +529,7 @@ GainMeterBase::gain_adjusted () } else { value = gain_adjustment.get_value(); } - + if (!ignore_toggle) { if (_route && _route->amp() == _amp) { _route->set_gain (value, this); diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index d081f62225..47b5f93a98 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -96,7 +96,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr pi, bool scrol smaller_hbox->pack_start (delete_button, false, false); smaller_hbox->pack_start (reset_button, false, false, 4); smaller_hbox->pack_start (bypass_button, false, true, 4); - + automation_manual_all_button.set_text(_("Manual")); automation_manual_all_button.set_name (X_("generic button")); automation_play_all_button.set_text(_("Play")); @@ -105,7 +105,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr pi, bool scrol automation_write_all_button.set_name (X_("generic button")); automation_touch_all_button.set_text(_("Touch")); automation_touch_all_button.set_name (X_("generic button")); - + Label* l = manage (new Label (_("All Automation"))); l->set_alignment (1.0, 0.5); automation_hbox->pack_start (*l, true, true); @@ -183,7 +183,7 @@ int value = -1; static int match_or_digit(char c1, char c2) { return c1 == c2 || (isdigit(c1) && isdigit(c2)); -} +} static std::size_t matching_chars_at_head(const string s1, const string s2) { std::size_t length, n = 0; @@ -374,13 +374,13 @@ GenericPluginUI::build () // Iterate over the list of controls to find which adjacent controls // are similar enough to be grouped together. - + string label, previous_label = ""; std::vector numbers_in_labels(cui_controls_list.size()); - + std::vector similarity_scores(cui_controls_list.size()); float most_similar = 0.0, least_similar = 1.0; - + i = 0; for (vector::iterator cuip = cui_controls_list.begin(); cuip != cui_controls_list.end(); ++cuip, ++i) { label = (*cuip)->label.get_text(); @@ -406,32 +406,32 @@ GenericPluginUI::build () } // cerr << "label: " << label << " sim: " << fixed << setprecision(3) << similarity_scores[i] << " num: " << numbers_in_labels[i] << endl; - previous_label = label; + previous_label = label; } - + // cerr << "most similar: " << most_similar << ", least similar: " << least_similar << endl; float similarity_threshold; - + if (most_similar > 1.0) { similarity_threshold = default_similarity_threshold; } else { similarity_threshold = most_similar - (1 - default_similarity_threshold); } - + // Now iterate over the list of controls to display them, placing an // HSeparator between controls of less than a certain similarity, and // starting a new column when necessary. - + i = 0; for (vector::iterator cuip = cui_controls_list.begin(); cuip != cui_controls_list.end(); ++cuip, ++i) { ControlUI* cui = *cuip; - + if (!is_scrollable) { x++; } - + if (x > max_controls_per_column || similarity_scores[i] <= similarity_threshold) { if (x > min_controls_per_column) { frame = manage (new Frame); @@ -477,7 +477,7 @@ GenericPluginUI::build () output_table.show_all (); button_table.show_all (); - + automation_manual_all_button.signal_clicked.connect(sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::set_all_automation), ARDOUR::Off)); automation_play_all_button.signal_clicked.connect(sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::set_all_automation), ARDOUR::Play)); automation_write_all_button.signal_clicked.connect(sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::set_all_automation), ARDOUR::Write)); @@ -601,7 +601,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param, int const steps = desc.integer_step ? (desc.upper - desc.lower + 1) / desc.step : 0; if (control_ui->scale_points && ((steps && int (control_ui->scale_points->size()) == steps) || desc.enumeration)) { - + /* Either: * a) There is a label for each possible value of this input, or * b) This port is marked as being an enumeration. @@ -612,7 +612,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param, ARDOUR::ScalePoints::const_iterator i = control_ui->scale_points->begin(); i != control_ui->scale_points->end(); ++i) { - + labels.push_back(i->first); } diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h index 4d7e0c95ff..a62d8d5b25 100644 --- a/gtk2_ardour/ghostregion.h +++ b/gtk2_ardour/ghostregion.h @@ -75,7 +75,7 @@ public: public: GhostEvent(::NoteBase *, ArdourCanvas::Container *); virtual ~GhostEvent (); - + NoteBase* event; ArdourCanvas::Item* item; }; diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index 7fb62ae973..be505b8c0d 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -69,7 +69,7 @@ GroupTabs::set_session (Session* s) _session->RouteRemovedFromRouteGroup.connect ( _session_connections, invalidator (*this), boost::bind (&GroupTabs::route_removed_from_route_group, this, _1, _2), gui_context() ); - + _session->route_group_removed.connect (_session_connections, invalidator (*this), boost::bind (&GroupTabs::set_dirty, this), gui_context()); } } @@ -138,7 +138,7 @@ GroupTabs::on_button_press_event (GdkEventButton* ev) } else if (ev->button == 3) { RouteGroup* g = t ? t->group : 0; - + if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier) && g) { /* edit */ RouteGroupDialog d (g, false); @@ -191,18 +191,18 @@ GroupTabs::on_button_release_event (GdkEventButton*) if (_dragging == 0) { return false; } - + if (!_drag_moved) { - + if (_dragging->group) { /* toggle active state */ _dragging->group->set_active (!_dragging->group->is_active (), this); } - + } else { /* finish drag */ RouteList routes = routes_for_tab (_dragging); - + if (!routes.empty()) { if (_dragging_new_tab) { RouteGroup* g = create_and_add_group (); @@ -214,13 +214,13 @@ GroupTabs::on_button_release_event (GdkEventButton*) } else { boost::shared_ptr r = _session->get_routes (); for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - + bool const was_in_tab = find ( _initial_dragging_routes.begin(), _initial_dragging_routes.end(), *i ) != _initial_dragging_routes.end (); - + bool const now_in_tab = find (routes.begin(), routes.end(), *i) != routes.end(); - + if (was_in_tab && !now_in_tab) { _dragging->group->remove (*i); } else if (!was_in_tab && now_in_tab) { @@ -229,11 +229,11 @@ GroupTabs::on_button_release_event (GdkEventButton*) } } } - + set_dirty (); queue_draw (); } - + _dragging = 0; _initial_dragging_routes.clear (); @@ -254,7 +254,7 @@ GroupTabs::render (cairo_t* cr, cairo_rectangle_t*) cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p()); cairo_rectangle (cr, 0, 0, get_width(), get_height()); cairo_fill (cr); - + /* tabs */ for (list::const_iterator i = _tabs.begin(); i != _tabs.end(); ++i) { @@ -551,20 +551,20 @@ GroupTabs::set_group_color (RouteGroup* group, uint32_t color) g = 25; b = 25; } - + GUIObjectState& gui_state = *ARDOUR_UI::instance()->gui_object_state; char buf[64]; - + /* for historical reasons the colors must be stored as 16 bit color * values. Ugh. */ snprintf (buf, sizeof (buf), "%d:%d:%d", (r<<8), (g<<8), (b<<8)); gui_state.set_property (group_gui_id (group), "color", buf); - + /* the group color change notification */ - + PBD::PropertyChange change; change.add (Properties::color); group->PropertyChanged (change); @@ -594,7 +594,7 @@ uint32_t GroupTabs::group_color (RouteGroup* group) { assert (group); - + GUIObjectState& gui_state = *ARDOUR_UI::instance()->gui_object_state; string const gui_id = group_gui_id (group); bool empty; @@ -630,7 +630,7 @@ GroupTabs::route_group_property_changed (RouteGroup* rg) */ emit_gui_changed_for_members (rg); - + set_dirty (); } diff --git a/gtk2_ardour/group_tabs.h b/gtk2_ardour/group_tabs.h index 16d6a85b31..e31ad9643e 100644 --- a/gtk2_ardour/group_tabs.h +++ b/gtk2_ardour/group_tabs.h @@ -67,7 +67,7 @@ protected: private: static void emit_gui_changed_for_members (ARDOUR::RouteGroup *); - + /** Compute all the tabs for this widget. * @return Tabs. */ diff --git a/gtk2_ardour/gui_object.cc b/gtk2_ardour/gui_object.cc index ca196613f0..3128e61f3a 100644 --- a/gtk2_ardour/gui_object.cc +++ b/gtk2_ardour/gui_object.cc @@ -157,4 +157,4 @@ GUIObjectState::all_ids () const return ids; } - + diff --git a/gtk2_ardour/gui_object.h b/gtk2_ardour/gui_object.h index b452e0cc44..39cf579fb5 100644 --- a/gtk2_ardour/gui_object.h +++ b/gtk2_ardour/gui_object.h @@ -55,7 +55,7 @@ public: static XMLNode* get_or_add_node (XMLNode *, const std::string &); void remove_node (const std::string& id); - + private: XMLNode _state; }; diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index 270ed8ce32..574b3cd0ca 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -259,7 +259,7 @@ void IOSelectorWindow::io_name_changed (void*) { ENSURE_GUI_THREAD (*this, &IOSelectorWindow::io_name_changed, src) - + std::string title; if (!_selector.find_inputs_for_io_outputs()) { diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index 28cd8b8508..cbbbfafc73 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -93,10 +93,10 @@ KeyEditor::KeyEditor () unbind_button.show (); } - + reset_button.add (reset_label); reset_label.set_markup (string_compose ("%1", _("Reset Bindings to Defaults"))); - + reset_box.pack_start (reset_button, true, false); reset_box.show (); reset_button.show (); diff --git a/gtk2_ardour/linux_vst_gui_support.cc b/gtk2_ardour/linux_vst_gui_support.cc index 4bae45c71e..e5722b2be0 100644 --- a/gtk2_ardour/linux_vst_gui_support.cc +++ b/gtk2_ardour/linux_vst_gui_support.cc @@ -74,7 +74,7 @@ bool LXVST_xerror; int TempErrorHandler(Display *display, XErrorEvent *e) { LXVST_xerror = true; - + return 0; } @@ -89,14 +89,14 @@ int getXWindowProperty(Window window, Atom atom) unsigned char *data; Atom userType; LXVST_xerror = false; - + /*Use our own Xerror handler while we're in here - in an attempt to stop the brain dead default Xerror behaviour of qutting the entire application because of e.g. an invalid window ID*/ - + XErrorHandler olderrorhandler = XSetErrorHandler(TempErrorHandler); - + XGetWindowProperty( LXVST_XDisplay, //The display window, //The Window atom, //The property @@ -109,14 +109,14 @@ int getXWindowProperty(Window window, Atom atom) &userCount, //Actual number of items stored in the returned data &bytes, //Number of bytes remaining if a partial read &data); //The actual data read - + if(LXVST_xerror == false && userCount == 1) result = *(int*)data; - + XSetErrorHandler(olderrorhandler); - + /*Hopefully this will return zero if the property is not set*/ - + return result; } @@ -138,14 +138,14 @@ long getXWindowProperty(Window window, Atom atom) unsigned char *data; Atom userType; LXVST_xerror = false; - + /*Use our own Xerror handler while we're in here - in an attempt to stop the brain dead default Xerror behaviour of qutting the entire application because of e.g. an invalid window ID*/ - + XErrorHandler olderrorhandler = XSetErrorHandler(TempErrorHandler); - + XGetWindowProperty( LXVST_XDisplay, window, atom, @@ -158,14 +158,14 @@ long getXWindowProperty(Window window, Atom atom) &userCount, &bytes, &data); - + if(LXVST_xerror == false && userCount == 1) result = *(long*)data; - + XSetErrorHandler(olderrorhandler); - + /*Hopefully this will return zero if the property is not set*/ - + return result; } @@ -178,70 +178,70 @@ static void dispatch_x_events (XEvent* event, VSTState* vstfx) { /*Handle some of the Events we might be interested in*/ - + switch(event->type) { /*Configure event - when the window is resized or first drawn*/ - + case ConfigureNotify: { Window window = event->xconfigure.event; - + int width = event->xconfigure.width; int height = event->xconfigure.height; - + /*If we get a config notify on the parent window XID then we need to see if the size has been changed - some plugins re-size their UI window e.g. when opening a preset manager (you might think that should be spawned as a new window...) */ - + /*if the size has changed, we flag this so that in lxvst_pluginui.cc we can make the change to the GTK parent window in ardour, from its UI thread*/ - + if (window == (Window) (vstfx->linux_window)) { if (width != vstfx->width || height!=vstfx->height) { vstfx->width = width; vstfx->height = height; vstfx->want_resize = 1; - + /*QUIRK : Loomer plugins not only resize the UI but throw it into some random position at the same time. We need to re-position the window at the origin of the parent window*/ - + if (vstfx->linux_plugin_ui_window) { XMoveWindow (LXVST_XDisplay, vstfx->linux_plugin_ui_window, 0, 0); } } } - + break; - + } - + /*Reparent Notify - when the plugin UI is reparented into our Host Window we will get an event here... probably... */ - + case ReparentNotify: { Window ParentWindow = event->xreparent.parent; - + /*If the ParentWindow matches the window for the vstfx instance then the Child window must be the XID of the pluginUI window created by the plugin, so we need to see if it has a callback stuck to it, and if so set that up in the vstfx */ - + /***********************************************************/ /* 64Bit --- This mechanism is not 64Bit compatible at the */ /* present time */ /***********************************************************/ - + if (ParentWindow == (Window) (vstfx->linux_window)) { Window PluginUIWindowID = event->xreparent.window; - + vstfx->linux_plugin_ui_window = PluginUIWindowID; #ifdef LXVST_32BIT int result = getXWindowProperty(PluginUIWindowID, XInternAtom(LXVST_XDisplay, "_XEventProc", false)); - + if (result == 0) { vstfx->eventProc = NULL; } else { @@ -250,7 +250,7 @@ dispatch_x_events (XEvent* event, VSTState* vstfx) #endif #ifdef LXVST_64BIT long result = getXWindowProperty(PluginUIWindowID, XInternAtom(LXVST_XDisplay, "_XEventProc", false)); - + if(result == 0) vstfx->eventProc = NULL; else @@ -259,47 +259,47 @@ dispatch_x_events (XEvent* event, VSTState* vstfx) } break; } - + case ClientMessage: { Window window = event->xany.window; Atom message_type = event->xclient.message_type; - + /*The only client message we are interested in is to signal that the plugin parent window is now valid and can be passed to effEditOpen when the editor is launched*/ - + if (window == (Window) (vstfx->linux_window)) { char* message = XGetAtomName(LXVST_XDisplay, message_type); - + if (strcmp(message,"LaunchEditor") == 0) { if (event->xclient.data.l[0] == 0x0FEEDBAC) { vstfx_launch_editor (vstfx); } } - + XFree(message); } break; } - + default: break; } - + /* Some VSTs built with toolkits e.g. JUCE will manager their own UI autonomously in the plugin, running the UI in its own thread, so once we have created a parent window for the plugin, its UI takes care of itself.*/ - + /*Other types register a callback as an Xwindow property on the plugin UI window after they create it. If that is the case, we need to call it here, passing the XEvent into it*/ - + if (vstfx->eventProc == NULL) { return; } - + vstfx->eventProc((void*)event); } @@ -312,11 +312,11 @@ maybe_set_program (VSTState* vstfx) } vstfx->plugin->dispatcher (vstfx->plugin, effSetProgram, 0, vstfx->want_program, NULL, 0); - + if (vstfx->vst_version >= 2) { vstfx->plugin->dispatcher (vstfx->plugin, 68 /* effEndSetProgram */, 0, 0, NULL, 0); } - + vstfx->want_program = -1; } @@ -336,10 +336,10 @@ void* gui_event_loop (void* ptr) int LXVST_sched_timer_interval = 40; //ms, 25fps XEvent event; uint64_t clock1, clock2; - + clock1 = g_get_monotonic_time(); /*The 'Forever' loop - runs the plugin UIs etc - based on the FST gui event loop*/ - + while (!gui_quit) { /* handle window creation requests, destroy requests, @@ -347,37 +347,37 @@ void* gui_event_loop (void* ptr) /*Look at the XEvent queue - if there are any XEvents we need to handle them, including passing them to all the plugin (eventProcs) we are currently managing*/ - + bool may_sleep = true; if(LXVST_XDisplay) { /*See if there are any events in the queue*/ - + int num_events = XPending(LXVST_XDisplay); if (num_events > 0) { // keep dispatching events as fast as possible may_sleep = false; } - + /*process them if there are any*/ - + while(num_events) { XNextEvent(LXVST_XDisplay, &event); - + /*Call dispatch events, with the event, for each plugin in the linked list*/ - + for (vstfx = vstfx_first; vstfx; vstfx = vstfx->next) - { + { pthread_mutex_lock(&vstfx->lock); - + dispatch_x_events(&event, vstfx); - + pthread_mutex_unlock(&vstfx->lock); } - + num_events--; } } @@ -385,7 +385,7 @@ void* gui_event_loop (void* ptr) /*We don't want to use all the CPU.. */ Glib::usleep(1000); - + /*See if its time for us to do a scheduled event pass on all the plugins*/ clock2 = g_get_monotonic_time(); @@ -395,34 +395,34 @@ void* gui_event_loop (void* ptr) { //printf("elapsed %d ms ^= %.2f Hz\n", elapsed_time_ms, 1000.0/(double)elapsed_time_ms); // DEBUG pthread_mutex_lock (&plugin_mutex); - + again: /*Parse through the linked list of plugins*/ - + for (vstfx = vstfx_first; vstfx; vstfx = vstfx->next) - { + { pthread_mutex_lock (&vstfx->lock); /*Window scheduled for destruction*/ - + if (vstfx->destroy) { if (vstfx->linux_window) { vstfx->plugin->dispatcher (vstfx->plugin, effEditClose, 0, 0, NULL, 0.0); - + XDestroyWindow (LXVST_XDisplay, vstfx->linux_window); /* FIXME - probably safe to assume we never have an XID of 0 but not explicitly true */ vstfx->linux_window = 0; vstfx->destroy = FALSE; } - + vstfx_event_loop_remove_plugin (vstfx); vstfx->been_activated = FALSE; pthread_cond_signal (&vstfx->window_status_change); pthread_mutex_unlock (&vstfx->lock); - + goto again; } - + /*Window does not yet exist - scheduled for creation*/ /* FIXME - probably safe to assume 0 is not a valid XID but not explicitly true */ @@ -441,9 +441,9 @@ again: maybe_set_program (vstfx); vstfx->want_program = -1; vstfx->want_chunk = 0; - + /*scheduled call to dispatcher*/ - + if (vstfx->dispatcher_wantcall) { vstfx->dispatcher_retval = vstfx->plugin->dispatcher ( vstfx->plugin, @@ -453,18 +453,18 @@ again: vstfx->dispatcher_ptr, vstfx->dispatcher_opt ); - + vstfx->dispatcher_wantcall = 0; pthread_cond_signal (&vstfx->plugin_dispatcher_called); } - + /*Call the editor Idle function in the plugin*/ - + vstfx->plugin->dispatcher (vstfx->plugin, effEditIdle, 0, 0, NULL, 0); if(vstfx->wantIdle) vstfx->plugin->dispatcher (vstfx->plugin, 53, 0, 0, NULL, 0); - + pthread_mutex_unlock (&vstfx->lock); } pthread_mutex_unlock (&plugin_mutex); @@ -490,54 +490,54 @@ int vstfx_init (void* ptr) { int thread_create_result; - + pthread_attr_t thread_attributes; - + /*Init the attribs to defaults*/ - + pthread_attr_init(&thread_attributes); - + /*Make sure the thread is joinable - this should be the default anyway - so we can join to it on vstfx_exit*/ - + pthread_attr_setdetachstate(&thread_attributes, PTHREAD_CREATE_JOINABLE); - + /*This is where we need to open a connection to X, and start the GUI thread*/ - + /*Open our connection to X - all linuxVST plugin UIs handled by the LXVST engine will talk to X down this connection - X cannot handle multi-threaded access via the same Display* */ - + if(LXVST_XDisplay==NULL) LXVST_XDisplay = XOpenDisplay(NULL); //We might be able to make this open a specific screen etc /*Drop out and report the error if we fail to connect to X */ - + if(LXVST_XDisplay==NULL) { vstfx_error ("** ERROR ** VSTFX: Failed opening connection to X"); - + return -1; } - + /*We have a connection to X - so start the gui event loop*/ - + /*Create the thread - use default attrs for now, don't think we need anything special*/ - + thread_create_result = pthread_create(&LXVST_gui_event_thread, NULL, gui_event_loop, NULL); - + if(thread_create_result!=0) { /*There was a problem starting the GUI event thread*/ - + vstfx_error ("** ERROR ** VSTFX: Failed starting GUI event thread"); - + XCloseDisplay(LXVST_XDisplay); - + return -1; } - + return 0; } @@ -546,10 +546,10 @@ int vstfx_init (void* ptr) void vstfx_exit() { gui_quit = 1; - + /*We need to pthread_join the gui_thread here so we know when it has stopped*/ - + pthread_join(LXVST_gui_event_thread, NULL); } @@ -565,14 +565,14 @@ int vstfx_run_editor (VSTState* vstfx) vstfx_first = vstfx; } else { VSTState* p = vstfx_first; - + while (p->next) { p = p->next; } p->next = vstfx; - + /* Mark the new end of the list */ - + vstfx->next = NULL; } @@ -581,11 +581,11 @@ int vstfx_run_editor (VSTState* vstfx) /* wait for the plugin editor window to be created (or not) */ pthread_mutex_lock (&vstfx->lock); - + if (!vstfx->linux_window) { pthread_cond_wait (&vstfx->window_status_change, &vstfx->lock); } - + pthread_mutex_unlock (&vstfx->lock); if (!vstfx->linux_window) { @@ -602,7 +602,7 @@ after run_editor has added the plugin (editor) to the linked list*/ int vstfx_create_editor (VSTState* vstfx) { Window parent_window; - + int x_size = 1; int y_size = 1; @@ -613,10 +613,10 @@ int vstfx_create_editor (VSTState* vstfx) vstfx_error ("** ERROR ** VSTFX: Plugin \"%s\" has no editor", vstfx->handle->name); return -1; } - - + + /*Create an XWindow for the plugin to inhabit*/ - + parent_window = XCreateSimpleWindow ( LXVST_XDisplay, DefaultRootWindow(LXVST_XDisplay), @@ -628,35 +628,35 @@ int vstfx_create_editor (VSTState* vstfx) 0, 0 ); - + /*Select the events we are interested in receiving - we need Substructure notify so that if the plugin resizes its window - e.g. Loomer Manifold then we get a message*/ - + XSelectInput(LXVST_XDisplay, parent_window, SubstructureNotifyMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask); - + vstfx->linux_window = parent_window; - + vstfx->xid = parent_window; //vstfx->xid will be referenced to connect to GTK UI in ardour later - + /*Because the plugin may be operating on a different Display* to us, and therefore the two event queues can be asynchronous, although we have created the window on our display, we can't guarantee it exists in the server yet, which will cause BadWindow crashes if the plugin tries to use it. - + It would be nice to use CreateNotify events here, but they don't get through on all window managers, so instead we pass a client message into out queue, after the XCreateWindow. When this message pops out in our event handler, it will trigger the second stage of plugin Editor instantiation, and by then the Window should be valid...*/ - + XClientMessageEvent event; - + /*Create an atom to identify our message (only if it doesn't already exist)*/ - + Atom WindowActiveAtom = XInternAtom(LXVST_XDisplay, "LaunchEditor", false); - + event.type = ClientMessage; event.send_event = true; event.window = parent_window; @@ -664,9 +664,9 @@ int vstfx_create_editor (VSTState* vstfx) event.format = 32; //Data format event.data.l[0] = 0x0FEEDBAC; //Something we can recognize later - + /*Push the event into the queue on our Display*/ - + XSendEvent(LXVST_XDisplay, parent_window, FALSE, NoEventMask, (XEvent*)&event); return 0; @@ -681,22 +681,22 @@ vstfx_launch_editor (VSTState* vstfx) is now valid in the XServer and can be passed to the plugin in effEditOpen without generating BadWindow errors when the plugin reparents itself into our parent window*/ - + if(vstfx->been_activated) return 0; - + Window parent_window; struct ERect* er; - + int x_size = 1; int y_size = 1; - + parent_window = vstfx->linux_window; - + /*Open the editor - Bah! we have to pass the int windowID as a void pointer - yuck it gets cast back to an int as the parent window XID in the plugin - and we have to pass the Display* as a long */ - + /**************************************************************/ /* 64Bit --- parent window is an int passed as a void* so */ /* that should be ok for 64Bit machines */ @@ -709,36 +709,36 @@ vstfx_launch_editor (VSTState* vstfx) /* */ /* linuxDSP VSTs don't use the host Display* at all */ /**************************************************************/ - + vstfx->plugin->dispatcher (vstfx->plugin, effEditOpen, 0, (long)LXVST_XDisplay, (void*)(parent_window), 0 ); - + /*QUIRK - some plugins need a slight delay after opening the editor before you can ask the window size or they might return zero - specifically discoDSP */ - + Glib::usleep(100000); - + /*Now we can find out how big the parent window should be (and try) to resize it*/ - + vstfx->plugin->dispatcher (vstfx->plugin, effEditGetRect, 0, 0, &er, 0 ); x_size = er->right - er->left; y_size = er->bottom - er->top; - + vstfx->width = x_size; vstfx->height = y_size; - + XResizeWindow(LXVST_XDisplay, parent_window, x_size, y_size); - + XFlush (LXVST_XDisplay); - + /*Not sure if we need to map the window or if the plugin will do it for us it should be ok because XReparentWindow generates a Map event*/ - + /*mark the editor as activated - mainly so that vstfx_get_XID will know it is valid*/ vstfx->been_activated = TRUE; - + pthread_cond_signal (&vstfx->window_status_change); return 0; } @@ -765,10 +765,10 @@ vstfx_event_loop_remove_plugin (VSTState* vstfx) so we don't need to lock here - if we did there would be a deadlock anyway */ - + VSTState* p; VSTState* prev; - + for (p = vstfx_first, prev = NULL; p; prev = p, p = p->next) { if (p == vstfx) { if (prev) { diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index 1e5334298b..4a2fc45a47 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -323,7 +323,7 @@ LocationEditRow::set_location (Location *loc) set_tooltip (start_to_playhead_button, _("Set range start from playhead location")); set_tooltip (end_to_playhead_button, _("Set range end from playhead location")); - + } else { set_tooltip (remove_button, _("Remove this marker")); @@ -903,7 +903,7 @@ LocationUI::location_added (Location* location) loc.sort (LocationSortByStart ()); LocationEditRow* erow = manage (new LocationEditRow (_session, location)); - + erow->set_clock_group (*_clock_group); erow->remove_requested.connect (sigc::mem_fun (*this, &LocationUI::location_remove_requested)); @@ -1132,7 +1132,7 @@ LocationUI::clock_mode_from_session_instant_xml () const if (!p) { return ARDOUR_UI::instance()->secondary_clock->mode(); } - + return (AudioClock::Mode) string_2_enum (p->value (), AudioClock::Mode); } diff --git a/gtk2_ardour/lxvst_plugin_ui.cc b/gtk2_ardour/lxvst_plugin_ui.cc index d2f6e757ed..ad8bc0175a 100644 --- a/gtk2_ardour/lxvst_plugin_ui.cc +++ b/gtk2_ardour/lxvst_plugin_ui.cc @@ -38,8 +38,8 @@ LXVSTPluginUI::LXVSTPluginUI (boost::shared_ptr pi, boost::shared_ LXVSTPluginUI::~LXVSTPluginUI () { - _screen_update_connection.disconnect(); - + _screen_update_connection.disconnect(); + // plugin destructor destroys the custom GUI, via the vstfx engine, // and then our PluginUIWindow does the rest } @@ -67,35 +67,35 @@ LXVSTPluginUI::resize_callback () /* We could maybe use this to resize the plugin GTK parent window if required */ - + if (!_vst->state()->want_resize) { return; } int new_height = _vst->state()->height; int new_width = _vst->state()->width; - + void* gtk_parent_window = _vst->state()->extra_data; - + if (gtk_parent_window) { ((Gtk::Window*) gtk_parent_window)->resize (new_width, new_height + LXVST_H_FIDDLE); } - + _vst->state()->want_resize = 0; } int LXVSTPluginUI::get_preferred_height () -{ +{ /* XXX: FIXME */ - + /* We have to return the required height of the plugin UI window + a fiddle factor because we can't know how big the preset menu bar is until the window is realised and we can't realise it until we have told it how big we would like it to be which we can't do until it is realised etc */ - // May not be 40 for all screen res etc + // May not be 40 for all screen res etc return VSTPluginUI::get_preferred_height () + LXVST_H_FIDDLE; } @@ -103,9 +103,9 @@ int LXVSTPluginUI::package (Gtk::Window& win) { VSTPluginUI::package (win); - + /* Map the UI start and stop updating events to 'Map' events on the Window */ - + win.signal_map_event().connect (mem_fun (*this, &LXVSTPluginUI::start_updating)); win.signal_unmap_event().connect (mem_fun (*this, &LXVSTPluginUI::stop_updating)); @@ -129,9 +129,9 @@ LXVSTPluginUI::get_XID () created and we get bad Window errors when trying to embed it in the GTK UI */ - + pthread_mutex_lock (&(_vst->state()->lock)); - + /* The Window may be scheduled for creation but not actually created by the gui_event_loop yet - spin here until it has been activated. Possible @@ -139,21 +139,21 @@ LXVSTPluginUI::get_XID () should not be called here if the window doesn't exist or will never exist */ - + while (!(_vst->state()->been_activated)) { Glib::usleep (1000); } - + int const id = _vst->state()->xid; - + pthread_mutex_unlock (&(_vst->state()->lock)); - + /* Finally it might be safe to return the ID - problems will arise if we return either a zero ID and GTK tries to socket it or if we return an ID which hasn't yet become real to the server */ - + return id; } @@ -166,7 +166,7 @@ static int gtk_xerror_handler (Display*, XErrorEvent*) { std::cerr << "** ERROR ** LXVSTPluginUI : Trapped an X Window System Error" << std::endl; - + return 0; } diff --git a/gtk2_ardour/lxvst_plugin_ui.h b/gtk2_ardour/lxvst_plugin_ui.h index 7342102bd7..14440c3b38 100644 --- a/gtk2_ardour/lxvst_plugin_ui.h +++ b/gtk2_ardour/lxvst_plugin_ui.h @@ -37,7 +37,7 @@ class LXVSTPluginUI : public VSTPluginUI ~LXVSTPluginUI (); int get_preferred_height (); - + bool start_updating (GdkEventAny *); bool stop_updating (GdkEventAny *); diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index e8aee1cdbe..b40490daa1 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -372,7 +372,7 @@ int main (int argc, char *argv[]) error << _("Could not complete pre-GUI initialization") << endmsg; exit (1); } - + try { ui = new ARDOUR_UI (&argc, &argv, localedir.c_str()); } catch (failed_constructor& err) { diff --git a/gtk2_ardour/main_clock.h b/gtk2_ardour/main_clock.h index 696b7e21e6..bf0712686a 100644 --- a/gtk2_ardour/main_clock.h +++ b/gtk2_ardour/main_clock.h @@ -28,7 +28,7 @@ public: MainClock (const std::string& clock_name, const std::string& widget_name, bool primary); private: - + // Editor *_editor; void build_ops_menu (); diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index 30be8fd786..2d9da96b0f 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -261,12 +261,12 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Container& parent, g group = new ArdourCanvas::Container (&parent, ArdourCanvas::Duple (unit_position, 0)); #ifdef CANVAS_DEBUG group->name = string_compose ("Marker::group for %1", annotation); -#endif +#endif _name_background = new ArdourCanvas::Rectangle (group); #ifdef CANVAS_DEBUG _name_background->name = string_compose ("Marker::_name_background for %1", annotation); -#endif +#endif /* adjust to properly locate the tip */ @@ -286,7 +286,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Container& parent, g layout->set_font_description (name_font); Gtkmm2ext::get_ink_pixel_size (layout, width, name_height); - + _name_item = new ArdourCanvas::Text (group); CANVAS_DEBUG_NAME (_name_item, string_compose ("ArdourMarker::_name_item for %1", annotation)); _name_item->set_font_description (name_font); @@ -303,7 +303,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Container& parent, g group->set_data ("marker", this); mark->set_data ("marker", this); - + if (handle_events) { group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), group, this)); } @@ -420,10 +420,10 @@ ArdourMarker::setup_name_display () if (label_on_left ()) { _name_item->set_x_position (-name_width); } - + _name_item->clamp_width (name_width); _name_item->set (_name); - + if (label_on_left ()) { /* adjust right edge of background to fit text */ _name_background->set_x0 (_name_item->position().x - padding); diff --git a/gtk2_ardour/meter_strip.h b/gtk2_ardour/meter_strip.h index 825bd6923d..dfeb406976 100644 --- a/gtk2_ardour/meter_strip.h +++ b/gtk2_ardour/meter_strip.h @@ -142,7 +142,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI void update_button_box (); void update_name_box (); void name_changed (); - + void route_color_changed (); bool _suspend_menu_callbacks; diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc index 9502a6879b..40ab968358 100644 --- a/gtk2_ardour/midi_channel_selector.cc +++ b/gtk2_ardour/midi_channel_selector.cc @@ -380,15 +380,15 @@ MidiChannelSelectorWindow::build () vpacker->pack_start (capture_all_button); capture_all_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), AllChannels)); - + vpacker->pack_start (capture_filter_button); capture_filter_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), FilterChannels)); - + vpacker->pack_start (capture_force_button); capture_force_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), ForceChannel)); vpacker->pack_start (capture_mask_box); - + capture_controls = manage (new HBox); capture_controls->set_spacing (6); @@ -416,10 +416,10 @@ MidiChannelSelectorWindow::build () vpacker->pack_start (playback_all_button); playback_all_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::playback_mode_toggled), AllChannels)); - + vpacker->pack_start (playback_filter_button); playback_filter_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::playback_mode_toggled), FilterChannels)); - + vpacker->pack_start (playback_force_button); playback_force_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::playback_mode_toggled), ForceChannel)); @@ -496,7 +496,7 @@ MidiChannelSelectorWindow::invert_capture_mask () track->set_capture_channel_mask (~track->get_capture_channel_mask()); } } - + void MidiChannelSelectorWindow::set_playback_selected_channels (uint16_t mask) { @@ -510,7 +510,7 @@ MidiChannelSelectorWindow::set_playback_selected_channels (uint16_t mask) playback_buttons[i]->set_active ((1<set_active ((1<set_sensitive (false); } } - + if (mode != ForceChannel) { set_playback_selected_channels (track->get_playback_channel_mask()); } @@ -703,10 +703,10 @@ MidiChannelSelectorWindow::capture_mode_changed () if (capture_buttons.empty()) { Gtkmm2ext::container_clear (capture_mask_box); - + ToggleButton* tb; RadioButtonGroup group; - + for (uint32_t n = 0; n < 16; ++n) { char buf[3]; snprintf (buf, sizeof (buf), "%d", n+1); @@ -736,7 +736,7 @@ MidiChannelSelectorWindow::capture_mode_changed () tb->set_sensitive (false); } } - + if (mode != ForceChannel) { set_capture_selected_channels (track->get_capture_channel_mask()); } @@ -803,7 +803,7 @@ MidiChannelSelectorWindow::capture_mode_toggled (ChannelMode mode) so we take action only if the button is active (i.e it is the one just clicked on) */ - + switch (mode) { case AllChannels: if (capture_all_button.get_active()) { @@ -833,7 +833,7 @@ MidiChannelSelectorWindow::playback_mode_toggled (ChannelMode mode) so we take action only if the button is active (i.e it is the one just clicked on) */ - + switch (mode) { case AllChannels: if (playback_all_button.get_active()) { @@ -860,7 +860,7 @@ MidiChannelSelectorWindow::set_channel_colors (const uint32_t new_channel_colors char color_normal[8]; char color_active[8]; - + snprintf(color_normal, 8, "#%x", UINT_INTERPOLATE(new_channel_colors[n], 0x000000ff, 0.6)); snprintf(color_active, 8, "#%x", new_channel_colors[n]); diff --git a/gtk2_ardour/midi_export_dialog.cc b/gtk2_ardour/midi_export_dialog.cc index dc15668dbd..34469adc39 100644 --- a/gtk2_ardour/midi_export_dialog.cc +++ b/gtk2_ardour/midi_export_dialog.cc @@ -67,5 +67,5 @@ std::string MidiExportDialog::get_path () const { return file_chooser.get_filename (); - + } diff --git a/gtk2_ardour/midi_list_editor.cc b/gtk2_ardour/midi_list_editor.cc index 29f81bdf5b..6334c38dcc 100644 --- a/gtk2_ardour/midi_list_editor.cc +++ b/gtk2_ardour/midi_list_editor.cc @@ -72,7 +72,7 @@ MidiListEditor::MidiListEditor (Session* s, boost::shared_ptr r, boo if (note_length_map.empty()) { fill_note_length_map (); } - + /* We do not handle nested sources/regions. Caller should have tackled this */ if (r->max_source_level() > 0) { @@ -90,7 +90,7 @@ MidiListEditor::MidiListEditor (Session* s, boost::shared_ptr r, boo note_length_model = ListStore::create (note_length_columns); TreeModel::Row row; - + for (std::map::iterator i = note_length_map.begin(); i != note_length_map.end(); ++i) { row = *(note_length_model->append()); row[note_length_columns.ticks] = i->first; @@ -152,7 +152,7 @@ MidiListEditor::MidiListEditor (Session* s, boost::shared_ptr r, boo buttons.attach (sound_notes_button, 0, 1, 0, 1); Glib::RefPtr act = ActionManager::get_action ("Editor", "sound-midi-notes"); if (act) { - gtk_activatable_set_related_action (GTK_ACTIVATABLE (sound_notes_button.gobj()), act->gobj()); + gtk_activatable_set_related_action (GTK_ACTIVATABLE (sound_notes_button.gobj()), act->gobj()); } view.show (); @@ -191,7 +191,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) if (!view.get_path_at_pos (ev->x, ev->y, path, col, cellx, celly)) { return false; } - + if (view.get_selection()->count_selected_rows() == 0) { was_selected = false; } else if (view.get_selection()->is_selected (path)) { @@ -199,7 +199,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) } else { was_selected = false; } - + int colnum = GPOINTER_TO_UINT (col->get_data (X_("colnum"))); switch (colnum) { @@ -274,19 +274,19 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) if (was_selected) { /* use selection */ - + TreeView::Selection::ListHandle_Path rows = view.get_selection()->get_selected_rows (); TreeModel::iterator iter; boost::shared_ptr note; - + for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { previous_selection.push_back (*i); if ((iter = model->get_iter (*i))) { - - note = (*iter)[columns._note]; - + + note = (*iter)[columns._note]; + switch (prop) { case MidiModel::NoteDiffCommand::StartTime: if (note->time() + fdelta >= 0) { @@ -321,7 +321,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) } else { /* just this row */ - + TreeModel::iterator iter; iter = model->get_iter (path); @@ -329,7 +329,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) if (iter) { boost::shared_ptr note = (*iter)[columns._note]; - + switch (prop) { case MidiModel::NoteDiffCommand::StartTime: if (note->time() + fdelta >= 0) { @@ -364,7 +364,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) m->apply_command (*_session, cmd); /* reset selection to be as it was before we rebuilt */ - + for (vector::iterator i = previous_selection.begin(); i != previous_selection.end(); ++i) { view.get_selection()->select (*i); } @@ -401,7 +401,7 @@ MidiListEditor::key_press (GdkEventKey* ev) ret = true; } break; - + case GDK_Up: case GDK_uparrow: if (edit_column > 0) { @@ -435,7 +435,7 @@ MidiListEditor::key_press (GdkEventKey* ev) case GDK_Escape: stop_editing (true); break; - + } return ret; @@ -486,7 +486,7 @@ MidiListEditor::key_release (GdkEventKey* ev) ret = true; } break; - + case GDK_r: if (_session && Gtkmm2ext::Keyboard::modifier_state_contains (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier)) { _session->redo (1); @@ -626,7 +626,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text) if (sscanf (text.c_str(), "%lf", &fval) == 1) { /* numeric value entered */ - + if (text.find ('.') == string::npos && text.find (',') == string::npos) { /* integral => units are ticks */ fval = fval / BBT_Time::ticks_per_beat; @@ -649,13 +649,13 @@ MidiListEditor::edited (const std::string& path, const std::string& text) * displaying numeric value ... use new value * from note length map, and convert to beats. */ - + for (x = note_length_map.begin(); x != note_length_map.end(); ++x) { if (x->second == text) { break; } } - + if (x != note_length_map.end()) { fval = x->first / BBT_Time::ticks_per_beat; } @@ -665,7 +665,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text) fval = -1.0; if (text != x->second) { - + /* get ticks for the newly selected * note length */ @@ -675,7 +675,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text) break; } } - + if (x != note_length_map.end()) { /* convert to beats */ fval = (double) x->first / BBT_Time::ticks_per_beat; @@ -702,12 +702,12 @@ MidiListEditor::edited (const std::string& path, const std::string& text) MidiModel::NoteDiffCommand* cmd = m->new_note_diff_command (opname); TreeView::Selection::ListHandle_Path rows = view.get_selection()->get_selected_rows (); - + for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { if ((iter = model->get_iter (*i))) { - note = (*iter)[columns._note]; - + note = (*iter)[columns._note]; + switch (prop) { case MidiModel::NoteDiffCommand::Velocity: cmd->change (note, prop, (uint8_t) (note->velocity() + idelta)); @@ -731,7 +731,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text) /* model has been redisplayed by now */ /* keep selected row(s), move cursor there, don't continue editing */ - + TreeViewColumn* col = view.get_column (edit_column); view.set_cursor (edit_path, *col, 0); @@ -776,7 +776,7 @@ MidiListEditor::redisplay_model () const Evoral::Beats dur = (*i)->end_time() - (*i)->time(); bbt.beats = dur.get_beats (); bbt.ticks = dur.get_ticks (); - + uint64_t len_ticks = (*i)->length().to_ticks(); std::map::iterator x = note_length_map.find (len_ticks); @@ -811,7 +811,7 @@ MidiListEditor::selection_changed () for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { if ((iter = model->get_iter (*i))) { - note = (*iter)[columns._note]; + note = (*iter)[columns._note]; player->add (note); } } diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 09b20f048d..5300a82574 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -271,7 +271,7 @@ MidiRegionView::init (bool wfd) NoteBase::NoteBaseDeleted.connect (note_delete_connection, MISSING_INVALIDATOR, boost::bind (&MidiRegionView::maybe_remove_deleted_note_from_selection, this, _1), gui_context()); - + if (wfd) { Glib::Threads::Mutex::Lock lm(midi_region()->midi_source(0)->mutex()); midi_region()->midi_source(0)->load_model(lm); @@ -502,10 +502,10 @@ MidiRegionView::button_press (GdkEventButton* ev) } if (_mouse_state != SelectTouchDragging) { - + _pressed_button = ev->button; _mouse_state = Pressed; - + return true; } @@ -578,7 +578,7 @@ MidiRegionView::button_release (GdkEventButton* ev) grid snap without it overlapping this one. */ beats -= Evoral::Beats::tick(); - + create_note_at (editor.pixel_to_sample (event_x), event_y, beats, true); break; @@ -646,9 +646,9 @@ MidiRegionView::motion (GdkEventMotion* ev) case Pressed: if (_pressed_button == 1) { - + MouseMode m = editor.current_mouse_mode(); - + if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) { editor.drags()->set (new NoteCreateDrag (dynamic_cast (&editor), group, this), (GdkEvent *) ev); _mouse_state = AddDragging; @@ -677,7 +677,7 @@ MidiRegionView::motion (GdkEventMotion* ev) case AddDragging: editor.drags()->motion_handler ((GdkEvent *) ev, false); break; - + case SelectTouchDragging: return false; @@ -733,7 +733,7 @@ MidiRegionView::key_press (GdkEventKey* ev) */ bool unmodified = Keyboard::no_modifier_keys_pressed (ev); - + if (unmodified && (ev->keyval == GDK_Alt_L || ev->keyval == GDK_Alt_R)) { _mouse_state = SelectTouchDragging; return true; @@ -878,7 +878,7 @@ MidiRegionView::velocity_edit () if (_selection.empty()) { return; } - + /* pick a note somewhat at random (since Selection is a set<>) to * provide the "current" velocity for the dialog. */ @@ -1191,7 +1191,7 @@ MidiRegionView::redisplay_model() bool visible; if (note_in_region_range (note, visible)) { - + if (!empty_when_starting && (cne = find_canvas_note (note)) != 0) { cne->validate (); @@ -1216,7 +1216,7 @@ MidiRegionView::redisplay_model() } } else { - + if (!empty_when_starting && (cne = find_canvas_note (note)) != 0) { cne->validate (); cne->hide (); @@ -1229,17 +1229,17 @@ MidiRegionView::redisplay_model() if (!empty_when_starting) { for (Events::iterator i = _events.begin(); i != _events.end(); ) { if (!(*i)->valid ()) { - + for (vector::iterator j = ghosts.begin(); j != ghosts.end(); ++j) { MidiGhostRegion* gr = dynamic_cast (*j); if (gr) { gr->remove_note (*i); } } - + delete *i; i = _events.erase (i); - + } else { ++i; } @@ -1303,7 +1303,7 @@ MidiRegionView::display_sysexes() for (MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) { const boost::shared_ptr > mev = boost::static_pointer_cast > (*i); - + if (mev) { if (mev->is_spp() || mev->is_mtc_quarter() || mev->is_mtc_full()) { have_periodic_system_messages = true; @@ -1311,19 +1311,19 @@ MidiRegionView::display_sysexes() } } } - + if (have_periodic_system_messages) { double zoom = trackview.editor().get_current_zoom (); // frames per pixel - + /* get an approximate value for the number of samples per video frame */ - + double video_frame = trackview.session()->frame_rate() * (1.0/30); - + /* if we are zoomed out beyond than the cutoff (i.e. more * frames per pixel than frames per 4 video frames), don't * show periodic sysex messages. */ - + if (zoom > (video_frame*4)) { display_periodic_messages = false; } @@ -1955,7 +1955,7 @@ patch_applies (const ARDOUR::MidiModel::constPatchChangePtr pc, Evoral::Beats ti { return pc->time() <= time && pc->channel() == channel; } - + void MidiRegionView::get_patch_key_at (Evoral::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key) const { @@ -2255,13 +2255,13 @@ MidiRegionView::select_matching_notes (uint8_t notenum, uint16_t channel_mask, b uint8_t high_note = 0; MidiModel::Notes& notes (_model->notes()); _optimization_iterator = _events.begin(); - + if (extend && !have_selection) { extend = false; } /* scan existing selection to get note range */ - + for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { if ((*i)->note()->note() < low_note) { low_note = (*i)->note()->note(); @@ -2270,7 +2270,7 @@ MidiRegionView::select_matching_notes (uint8_t notenum, uint16_t channel_mask, b high_note = (*i)->note()->note(); } } - + if (!add) { clear_selection (); @@ -2593,7 +2593,7 @@ MidiRegionView::note_dropped(NoteBase *, frameoffset_t dt, int8_t dnote) start_note_diff_command (_("move notes")); for (Selection::iterator i = _selection.begin(); i != _selection.end() ; ++i) { - + framepos_t new_frames = source_beats_to_absolute_frames ((*i)->note()->time()) + dt; Evoral::Beats new_time = absolute_frames_to_source_beats (new_frames); @@ -2857,7 +2857,7 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_ /* Get the new x position for this resize, which is in pixels relative * to the region position. */ - + double current_x; if (at_front) { @@ -3711,7 +3711,7 @@ MidiRegionView::update_ghost_note (double x, double y) _note_group->canvas_to_item (x, y); PublicEditor& editor = trackview.editor (); - + framepos_t const unsnapped_frame = editor.pixel_to_sample (x); framecnt_t grid_frames; framepos_t const f = snap_frame_to_grid_underneath (unsnapped_frame, grid_frames); @@ -4084,7 +4084,7 @@ framepos_t MidiRegionView::snap_frame_to_grid_underneath (framepos_t p, framecnt_t& grid_frames) const { PublicEditor& editor = trackview.editor (); - + const Evoral::Beats grid_beats = get_grid_beats(p); grid_frames = region_beats_to_region_frames (grid_beats); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index bcc4e7aca2..786a7ec7c4 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -309,7 +309,7 @@ public: Selection selection () const { return _selection; } - + void selection_as_notelist (Notes& selected, bool allow_all_if_none_selected = false); void enable_display (bool); @@ -331,7 +331,7 @@ public: void clear_selection (bool signal = true) { clear_selection_except (0, signal); } ARDOUR::InstrumentInfo& instrument_info() const; - + protected: void region_resized (const PBD::PropertyChange&); @@ -401,7 +401,7 @@ private: uint8_t _current_range_min; uint8_t _current_range_max; - + typedef std::list Events; typedef std::vector< boost::shared_ptr > PatchChanges; typedef std::vector< boost::shared_ptr > SysExes; @@ -514,7 +514,7 @@ private: bool _mouse_changed_selection; framepos_t snap_frame_to_grid_underneath (framepos_t p, framecnt_t &) const; - + PBD::ScopedConnection _mouse_mode_connection; boost::shared_ptr _press_cursor_ctx; diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index d1a479d28c..ce34fb9b88 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -75,7 +75,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv) can be put below ghost regions from MIDI underlays */ _note_lines = new ArdourCanvas::LineSet (_canvas_group, ArdourCanvas::LineSet::Horizontal); - + _note_lines->Event.connect( sigc::bind(sigc::mem_fun(_trackview.editor(), &PublicEditor::canvas_stream_view_event), @@ -345,7 +345,7 @@ MidiStreamView::draw_note_lines() double h = y - prev_y; double mid = y + (h/2.0); - + if (height > 1.0) { // XXX ? should that not be h >= 1 ? _note_lines->add (mid, h, color); } @@ -647,7 +647,7 @@ void MidiStreamView::resume_updates () { _updates_suspended = false; - + draw_note_lines (); apply_note_range_to_regions (); diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 934cc6a21d..9564ed239c 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -132,7 +132,7 @@ void MidiTimeAxisView::set_route (boost::shared_ptr rt) { _route = rt; - + _view = new MidiStreamView (*this); if (is_track ()) { @@ -319,11 +319,11 @@ MidiTimeAxisView::set_route (boost::shared_ptr rt) _channel_status_box.set_homogeneous (false); _channel_status_box.set_spacing (4); - + ArdourButton *channel_selector_button = manage (new ArdourButton(_("Chns"))); channel_selector_button->set_name ("route button"); set_tooltip (channel_selector_button, _("Click to edit channel settings")); - + // Insert expanding space labels to get full width justification _channel_status_box.pack_start (_playback_channel_status, false, false, 2); _channel_status_box.pack_start (*Gtk::manage(new Gtk::Label(" ")), true, true); @@ -333,7 +333,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr rt) _channel_status_box.show_all (); channel_selector_button->signal_clicked.connect (sigc::mem_fun (*this, &MidiTimeAxisView::toggle_channel_selector)); - + _midi_controls_box.pack_start (_channel_status_box, false, false, 10); if (!patch_manager.all_models().empty()) { @@ -483,7 +483,7 @@ MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m) } else { _midi_controls_box.hide(); } - + if (h >= KEYBOARD_MIN_HEIGHT) { if (is_track() && _range_scroomer) { _range_scroomer->show(); @@ -539,7 +539,7 @@ MidiTimeAxisView::append_extra_display_menu_items () if (color_mode_menu) { items.push_back (MenuElem (_("Color Mode"), *color_mode_menu)); } - + items.push_back (SeparatorElem ()); } @@ -921,7 +921,7 @@ MidiTimeAxisView::build_controller_menu () l != device_names->controls().end(); ++l) { boost::shared_ptr name_list = l->second; Menu* ctl_menu = NULL; - + for (ControlNameList::Controls::const_iterator c = name_list->controls().begin(); c != name_list->controls().end();) { const uint16_t ctl = c->second->number(); @@ -931,7 +931,7 @@ MidiTimeAxisView::build_controller_menu () /* Create a new submenu */ ctl_menu = manage (new Menu); } - + MenuList& ctl_items (ctl_menu->items()); if (chn_cnt > 1) { add_multi_channel_controller_item(ctl_items, ctl, c->second->name()); @@ -1069,7 +1069,7 @@ MidiTimeAxisView::set_color_mode (ColorMode mode, bool force, bool redisplay, bo if (_color_mode == mode && !force) { return; } - + if (_channel_selector) { if (mode == ChannelColors) { _channel_selector->set_channel_colors(NoteBase::midi_channel_colors); @@ -1077,7 +1077,7 @@ MidiTimeAxisView::set_color_mode (ColorMode mode, bool force, bool redisplay, bo _channel_selector->set_default_channel_color(); } } - + _color_mode = mode; set_gui_property ("color-mode", enum_2_string(_color_mode)); if (redisplay) { diff --git a/gtk2_ardour/midi_tracer.cc b/gtk2_ardour/midi_tracer.cc index fbee3552c3..3d5e6ac796 100644 --- a/gtk2_ardour/midi_tracer.cc +++ b/gtk2_ardour/midi_tracer.cc @@ -131,7 +131,7 @@ MidiTracer::ports_changed () { string const c = _port_combo.get_active_text (); _port_combo.clear (); - + ARDOUR::PortManager::PortList pl; ARDOUR::AudioEngine::instance()->get_ports (ARDOUR::DataType::MIDI, pl); @@ -182,7 +182,7 @@ MidiTracer::port_changed () mp->set_trace_on (true); traced_port = mp; } - + } else { async->parser()->any.connect_same_thread (_parser_connection, boost::bind (&MidiTracer::tracer, this, _1, _2, _3)); } diff --git a/gtk2_ardour/midi_tracer.h b/gtk2_ardour/midi_tracer.h index 63a17d4bc9..e0e3f01dc9 100644 --- a/gtk2_ardour/midi_tracer.h +++ b/gtk2_ardour/midi_tracer.h @@ -57,7 +57,7 @@ class MidiTracer : public ArdourWindow Gtk::Label line_count_label; Gtk::HBox line_count_box; struct timeval _last_receipt; - + bool autoscroll; bool show_hex; bool show_delta_time; diff --git a/gtk2_ardour/midi_velocity_dialog.cc b/gtk2_ardour/midi_velocity_dialog.cc index 13a960c0db..5b21e566e4 100644 --- a/gtk2_ardour/midi_velocity_dialog.cc +++ b/gtk2_ardour/midi_velocity_dialog.cc @@ -41,7 +41,7 @@ MidiVelocityDialog::MidiVelocityDialog (uint8_t current_velocity) add_button (Stock::CANCEL, RESPONSE_CANCEL); add_button (Stock::OK, RESPONSE_OK); - + spinner.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &MidiVelocityDialog::response), Gtk::RESPONSE_OK)); } diff --git a/gtk2_ardour/mixer_actor.cc b/gtk2_ardour/mixer_actor.cc index dfbdf1a12c..ffd68ff6c4 100644 --- a/gtk2_ardour/mixer_actor.cc +++ b/gtk2_ardour/mixer_actor.cc @@ -80,7 +80,7 @@ void MixerActor::load_bindings () { /* XXX move this to a better place */ - + bindings.set_action_map (myactions); std::string binding_file; diff --git a/gtk2_ardour/mixer_group_tabs.cc b/gtk2_ardour/mixer_group_tabs.cc index e7d82ae708..f84c53b8e1 100644 --- a/gtk2_ardour/mixer_group_tabs.cc +++ b/gtk2_ardour/mixer_group_tabs.cc @@ -101,13 +101,13 @@ MixerGroupTabs::draw_tab (cairo_t* cr, Tab const & tab) const { double const arc_radius = get_height(); double r, g, b, a; - + if (tab.group && tab.group->is_active()) { ArdourCanvas::color_to_rgba (tab.color, r, g, b, a); } else { ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a); } - + a = 1.0; cairo_set_source_rgba (cr, r, g, b, a); @@ -122,7 +122,7 @@ MixerGroupTabs::draw_tab (cairo_t* cr, Tab const & tab) const cairo_text_extents_t ext; cairo_text_extents (cr, tab.group->name().c_str(), &ext); - + ArdourCanvas::Color c = ArdourCanvas::contrasting_text_color (ArdourCanvas::rgba_to_color (r, g, b, a)); ArdourCanvas::color_to_rgba (c, r, g, b, a); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 57501062a4..2ff54512c6 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -154,7 +154,7 @@ MixerStrip::init () if (_mixer_owned) { t += string_compose (_("\n%1-%2-click to toggle the width of all strips."), Keyboard::primary_modifier_name(), Keyboard::tertiary_modifier_name ()); } - + width_button.set_icon (ArdourIcon::StripWidth); set_tooltip (width_button, t); @@ -162,7 +162,7 @@ MixerStrip::init () set_tooltip (&hide_button, _("Hide this mixer strip")); input_button_box.set_spacing(2); - + input_button.set_text (_("Input")); input_button.set_name ("mixer strip button"); input_button_box.pack_start (input_button, true, true); @@ -177,7 +177,7 @@ MixerStrip::init () meter_point_button.signal_button_press_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_press), false); meter_point_button.signal_button_release_event().connect (sigc::mem_fun (gpm, &GainMeter::meter_release), false); - + hide_button.set_events (hide_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); solo_isolated_led = manage (new ArdourButton (ArdourButton::led_default_elements)); @@ -238,7 +238,7 @@ MixerStrip::init () button_size_group->add_widget (*monitor_input_button); } } - + mute_solo_table.set_homogeneous (true); mute_solo_table.set_spacings (2); @@ -408,7 +408,7 @@ bool MixerStrip::mixer_strip_enter_event (GdkEventCrossing* /*ev*/) { _entered_mixer_strip = this; - + //although we are triggering on the "enter", to the user it will appear that it is happenin on the "leave" //because the mixerstrip control is a parent that encompasses the strip deselect_all_processors(); @@ -431,7 +431,7 @@ MixerStrip::mixer_strip_leave_event (GdkEventCrossing *ev) //if we leave this mixer strip we need to clear out any selections //processor_box.processor_display.select_none(); //but this doesn't work, because it gets triggered when (for example) you open the menu or start a drag } - + return false; } @@ -456,7 +456,7 @@ MixerStrip::set_route (boost::shared_ptr rt) if (group_button.get_parent()) { bottom_button_table.remove (group_button); } - + RouteUI::set_route (rt); /* ProcessorBox needs access to _route so that it can read @@ -469,7 +469,7 @@ MixerStrip::set_route (boost::shared_ptr rt) /* unpack these from the parent and stuff them into our own table */ - + if (gpm.peak_display.get_parent()) { gpm.peak_display.get_parent()->remove (gpm.peak_display); } @@ -478,7 +478,7 @@ MixerStrip::set_route (boost::shared_ptr rt) } gpm.set_type (rt->meter_type()); - + mute_solo_table.attach (gpm.gain_display,0,1,1,2, EXPAND|FILL, EXPAND); mute_solo_table.attach (gpm.peak_display,1,2,1,2, EXPAND|FILL, EXPAND); @@ -798,7 +798,7 @@ MixerStrip::output_release (GdkEventButton *ev) edit_output_configuration (); break; } - + return false; } @@ -869,7 +869,7 @@ MixerStrip::output_press (GdkEventButton *ev) ) ); } - + citems.push_back (SeparatorElem()); citems.push_back (MenuElem (_("Routing Grid"), sigc::mem_fun (*(static_cast(this)), &RouteUI::edit_output_configuration))); @@ -929,7 +929,7 @@ MixerStrip::input_press (GdkEventButton *ev) citems.push_back (SeparatorElem()); uint32_t const n_with_separator = citems.size (); - + input_menu_bundles.clear (); ARDOUR::BundleList current = _route->input()->bundles_connected (); @@ -1195,7 +1195,7 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt ostringstream tooltip; char * tooltip_cstr; - + //to avoid confusion, the button caption should only show connections that match the datatype of the track DataType dt = DataType::AUDIO; if ( boost::dynamic_pointer_cast(route) != 0 ) { @@ -1220,7 +1220,7 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt } else { port = route->output()->nth (io_index); } - + port_connections.clear (); port->get_connections(port_connections); @@ -1598,7 +1598,7 @@ MixerStrip::build_route_ops_menu () if (!selection.selected (rtav)) { selection.set (rtav); } - + items.push_front (SeparatorElem()); items.push_front (MenuElem (_("Remove"), sigc::mem_fun(PublicEditor::instance(), &PublicEditor::remove_tracks))); } @@ -1644,7 +1644,7 @@ MixerStrip::number_button_button_press (GdkEventButton* ev) /* do not allow rename if the track is record-enabled */ rename_menu_item->set_sensitive (!_route->record_enabled()); route_ops_menu->popup (1, ev->time); - + return true; } @@ -1670,7 +1670,7 @@ MixerStrip::set_selected (bool yn) global_frame.set_name ("MixerStripFrame"); } global_frame.queue_draw (); - + // if (!yn) // processor_box.deselect_all_processors(); } @@ -1735,7 +1735,7 @@ MixerStrip::width_button_pressed (GdkEventButton* ev) if (ev->button != 1) { return false; } - + if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier | Keyboard::TertiaryModifier)) && _mixer_owned) { switch (_width) { case Wide: @@ -1880,19 +1880,19 @@ MixerStrip::meter_point_string (MeterPoint mp) case MeterInput: return _("In"); break; - + case MeterPreFader: return _("Pre"); break; - + case MeterPostFader: return _("Post"); break; - + case MeterOutput: return _("Out"); break; - + case MeterCustom: default: return _("Custom"); @@ -1904,19 +1904,19 @@ MixerStrip::meter_point_string (MeterPoint mp) case MeterInput: return S_("Meter|In"); break; - + case MeterPreFader: return S_("Meter|Pr"); break; - + case MeterPostFader: return S_("Meter|Po"); break; - + case MeterOutput: return S_("Meter|O"); break; - + case MeterCustom: default: return S_("Meter|C"); @@ -2204,7 +2204,7 @@ MixerStrip::override_solo_visibility () const if (_route && _route->is_master ()) { return boost::optional (false); } - + return boost::optional (); } @@ -2362,7 +2362,7 @@ MixerStrip::add_level_meter_item_point (Menu_Helpers::MenuList& items, RadioMenuItem::Group& group, string const & name, MeterPoint point) { using namespace Menu_Helpers; - + items.push_back (RadioMenuElem (group, name, sigc::bind (sigc::mem_fun (*this, &MixerStrip::set_meter_point), point))); RadioMenuItem* i = dynamic_cast (&items.back ()); i->set_active (_route->meter_point() == point); @@ -2380,7 +2380,7 @@ MixerStrip::add_level_meter_item_type (Menu_Helpers::MenuList& items, RadioMenuItem::Group& group, string const & name, MeterType type) { using namespace Menu_Helpers; - + items.push_back (RadioMenuElem (group, name, sigc::bind (sigc::mem_fun (*this, &MixerStrip::set_meter_type), type))); RadioMenuItem* i = dynamic_cast (&items.back ()); i->set_active (_route->meter_type() == type); diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index cf2a90e4b4..b742382d73 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -299,7 +299,7 @@ Mixer_UI::show_window () ms->parameter_changed (X_("mixer-element-visibility")); } } - + /* force focus into main area */ scroller_base.grab_focus (); @@ -343,44 +343,44 @@ Mixer_UI::add_strips (RouteList& routes) for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) { boost::shared_ptr route = (*x); - + if (route->is_auditioner()) { continue; } - + if (route->is_monitor()) { - + if (!_monitor_section) { _monitor_section = new MonitorSection (_session); - + XMLNode* mnode = ARDOUR_UI::instance()->tearoff_settings (X_("monitor-section")); if (mnode) { _monitor_section->tearoff().set_state (*mnode); } } - + out_packer.pack_end (_monitor_section->tearoff(), false, false); _monitor_section->set_session (_session); _monitor_section->tearoff().show_all (); - + route->DropReferences.connect (*this, invalidator(*this), boost::bind (&Mixer_UI::monitor_section_going_away, this), gui_context()); - + /* no regular strip shown for control out */ - + continue; } - + strip = new MixerStrip (*this, _session, route); strips.push_back (strip); UIConfiguration::instance().get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide; - + if (strip->width_owner() != strip) { strip->set_width_enum (_strip_width, this); } - + show_strip (strip); - + TreeModel::Row row = *(track_model->insert(insert_iter)); row[track_columns.text] = route->name(); row[track_columns.visible] = strip->route()->is_master() ? true : strip->marked_for_display(); @@ -390,9 +390,9 @@ Mixer_UI::add_strips (RouteList& routes) if (!from_scratch) { _selection.add (strip); } - + route->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context()); - + strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed)); strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); } @@ -402,7 +402,7 @@ Mixer_UI::add_strips (RouteList& routes) no_track_list_redisplay = false; track_display.set_model (track_model); - + sync_order_keys_from_treeview (); redisplay_track_list (); } @@ -442,11 +442,11 @@ Mixer_UI::remove_strip (MixerStrip* strip) TreeModel::Children rows = track_model->children(); TreeModel::Children::iterator ri; list::iterator i; - + if ((i = find (strips.begin(), strips.end(), strip)) != strips.end()) { strips.erase (i); } - + for (ri = rows.begin(); ri != rows.end(); ++ri) { if ((*ri)[track_columns.strip] == strip) { PBD::Unwinder uw (_route_deletion_in_progress, true); @@ -464,7 +464,7 @@ Mixer_UI::reset_remote_control_ids () } TreeModel::Children rows = track_model->children(); - + if (rows.empty()) { return; } @@ -479,11 +479,11 @@ Mixer_UI::reset_remote_control_ids () for (ri = rows.begin(); ri != rows.end(); ++ri) { /* skip two special values */ - + if (rid == Route::MasterBusRemoteControlID) { rid++; } - + if (rid == Route::MonitorBusRemoteControlID) { rid++; } @@ -492,14 +492,14 @@ Mixer_UI::reset_remote_control_ids () bool visible = (*ri)[track_columns.visible]; if (!route->is_master() && !route->is_monitor()) { - + uint32_t new_rid = (visible ? rid : invisible_key--); - + if (new_rid != route->remote_control_id()) { - route->set_remote_control_id_explicit (new_rid); + route->set_remote_control_id_explicit (new_rid); rid_change = true; } - + if (visible) { rid++; } @@ -520,7 +520,7 @@ Mixer_UI::sync_order_keys_from_treeview () } TreeModel::Children rows = track_model->children(); - + if (rows.empty()) { return; } @@ -550,10 +550,10 @@ Mixer_UI::sync_order_keys_from_treeview () uint32_t new_rid = (visible ? rid : invisible_key--); if (new_rid != route->remote_control_id()) { - route->set_remote_control_id_explicit (new_rid); + route->set_remote_control_id_explicit (new_rid); rid_change = true; } - + if (visible) { rid++; } @@ -610,7 +610,7 @@ Mixer_UI::sync_treeview_from_order_keys () neworder.assign (sorted_routes.size(), 0); uint32_t n = 0; - + for (OrderKeySortedRoutes::iterator sr = sorted_routes.begin(); sr != sorted_routes.end(); ++sr, ++n) { neworder[n] = sr->old_display_order; @@ -640,7 +640,7 @@ Mixer_UI::follow_editor_selection () _following_editor_selection = true; _selection.block_routes_changed (true); - + TrackSelection& s (PublicEditor::instance().get_selection().tracks); _selection.clear_routes (); @@ -690,13 +690,13 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip) } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::RangeSelectModifier)) { if (!_selection.selected(strip)) { - + /* extend selection */ - + vector tmp; bool accumulate = false; bool found_another = false; - + tmp.push_back (strip); for (list::iterator i = strips.begin(); i != strips.end(); ++i) { @@ -845,15 +845,15 @@ Mixer_UI::update_track_visibility () { Unwinder uw (no_track_list_redisplay, true); - + for (i = rows.begin(); i != rows.end(); ++i) { MixerStrip *strip = (*i)[track_columns.strip]; (*i)[track_columns.visible] = strip->marked_for_display (); } - + /* force route order keys catch up with visibility changes */ - + sync_order_keys_from_treeview (); } @@ -926,20 +926,20 @@ Mixer_UI::set_all_strips_visibility (bool yn) { Unwinder uw (no_track_list_redisplay, true); - + for (i = rows.begin(); i != rows.end(); ++i) { - + TreeModel::Row row = (*i); MixerStrip* strip = row[track_columns.strip]; - + if (strip == 0) { continue; } - + if (strip->route()->is_master() || strip->route()->is_monitor()) { continue; } - + (*i)[track_columns.visible] = yn; } } @@ -956,33 +956,33 @@ Mixer_UI::set_all_audio_midi_visibility (int tracks, bool yn) { Unwinder uw (no_track_list_redisplay, true); - + for (i = rows.begin(); i != rows.end(); ++i) { TreeModel::Row row = (*i); MixerStrip* strip = row[track_columns.strip]; - + if (strip == 0) { continue; } - + if (strip->route()->is_master() || strip->route()->is_monitor()) { continue; } - + boost::shared_ptr at = strip->audio_track(); boost::shared_ptr mt = strip->midi_track(); - + switch (tracks) { case 0: (*i)[track_columns.visible] = yn; break; - + case 1: if (at) { /* track */ (*i)[track_columns.visible] = yn; } break; - + case 2: if (!at && !mt) { /* bus */ (*i)[track_columns.visible] = yn; @@ -1077,7 +1077,7 @@ Mixer_UI::redisplay_track_list () { TreeModel::Children rows = track_model->children(); TreeModel::Children::iterator i; - + if (no_track_list_redisplay) { return; } @@ -1176,7 +1176,7 @@ Mixer_UI::initial_track_display () track_model->clear (); add_strips (copy); } - + _session->sync_order_keys (); redisplay_track_list (); @@ -1792,7 +1792,7 @@ Mixer_UI::on_key_release_event (GdkEventKey* ev) } KeyboardKey k (ev->state, ev->keyval); - + if (bindings.activate (k, Bindings::Release)) { return true; } @@ -1935,7 +1935,7 @@ Mixer_UI::update_title () { if (_session) { string n; - + if (_session->snap_name() != _session->name()) { n = _session->snap_name (); } else { @@ -1945,14 +1945,14 @@ Mixer_UI::update_title () if (_session->dirty ()) { n = "*" + n; } - + WindowTitle title (n); title += S_("Window|Mixer"); title += Glib::get_application_name (); set_title (title.get_string()); } else { - + WindowTitle title (S_("Window|Mixer")); title += Glib::get_application_name (); set_title (title.get_string()); @@ -2015,7 +2015,7 @@ Mixer_UI::toggle_midi_input_active (bool flip_others) onoff = !mt->input_active(); } } - + _session->set_exclusive_input_active (rl, onoff, flip_others); } diff --git a/gtk2_ardour/monitor_selector.cc b/gtk2_ardour/monitor_selector.cc index ad5b799627..5f71a79b6f 100644 --- a/gtk2_ardour/monitor_selector.cc +++ b/gtk2_ardour/monitor_selector.cc @@ -237,7 +237,7 @@ void MonitorSelectorWindow::io_name_changed (void*) { ENSURE_GUI_THREAD (*this, &MonitorSelectorWindow::io_name_changed, src) - + std::string title; if (!_selector.find_inputs_for_io_outputs()) { diff --git a/gtk2_ardour/mono_panner.cc b/gtk2_ardour/mono_panner.cc index f5bba63446..23b64eee28 100644 --- a/gtk2_ardour/mono_panner.cc +++ b/gtk2_ardour/mono_panner.cc @@ -93,7 +93,7 @@ MonoPanner::MonoPanner (boost::shared_ptr p) MonoPanner::~MonoPanner () { - + } void diff --git a/gtk2_ardour/mono_panner.h b/gtk2_ardour/mono_panner.h index 4d5f1ffec0..c5843f756c 100644 --- a/gtk2_ardour/mono_panner.h +++ b/gtk2_ardour/mono_panner.h @@ -58,7 +58,7 @@ class MonoPanner : public PannerInterface private: PannerEditor* editor (); boost::shared_ptr _panner_shell; - + boost::shared_ptr position_control; PBD::ScopedConnectionList panvalue_connections; PBD::ScopedConnectionList panshell_connections; diff --git a/gtk2_ardour/mono_panner_editor.cc b/gtk2_ardour/mono_panner_editor.cc index cf8c57a8e1..134c812822 100644 --- a/gtk2_ardour/mono_panner_editor.cc +++ b/gtk2_ardour/mono_panner_editor.cc @@ -38,12 +38,12 @@ MonoPannerEditor::MonoPannerEditor (MonoPanner* p) t->set_spacings (6); int n = 0; - + t->attach (*manage (left_aligned_label (_("Left"))), 0, 1, n, n + 1); t->attach (_left, 1, 2, n, n + 1); t->attach (*manage (left_aligned_label (_("%"))), 2, 3, n, n + 1); ++n; - + t->attach (*manage (left_aligned_label (_("Right"))), 0, 1, n, n + 1); t->attach (_right, 1, 2, n, n + 1); t->attach (*manage (left_aligned_label (_("%"))), 2, 3, n, n + 1); @@ -78,7 +78,7 @@ MonoPannerEditor::update_editor () if (!_panner) { return; } - + float const v = _panner->get_controllable()->get_value(); _ignore_changes = true; @@ -110,7 +110,7 @@ MonoPannerEditor::right_changed () } float const v = _right.get_value () / 100; - + _ignore_changes = true; _left.set_value (100 * (1 - v)); _panner->get_controllable()->set_value (v); diff --git a/gtk2_ardour/mono_panner_editor.h b/gtk2_ardour/mono_panner_editor.h index eb4e857e96..f8b12cf25c 100644 --- a/gtk2_ardour/mono_panner_editor.h +++ b/gtk2_ardour/mono_panner_editor.h @@ -33,7 +33,7 @@ private: void update_editor (); void left_changed (); void right_changed (); - + MonoPanner* _panner; Gtk::SpinButton _left; Gtk::SpinButton _right; diff --git a/gtk2_ardour/mouse_cursors.cc b/gtk2_ardour/mouse_cursors.cc index dc14d60086..68ad19ebb7 100644 --- a/gtk2_ardour/mouse_cursors.cc +++ b/gtk2_ardour/mouse_cursors.cc @@ -147,7 +147,7 @@ MouseCursors::set_cursor_set (const std::string& name) } /* these will throw exceptions if their images cannot be found. - + the default hotspot coordinates will be overridden by any data found by Gtkmm2ext::Cursors::load_cursor_info(). the values here from the set of cursors used by Ardour; new cursor/icon diff --git a/gtk2_ardour/mouse_cursors.h b/gtk2_ardour/mouse_cursors.h index 5e40a84c4c..8cd98ac32c 100644 --- a/gtk2_ardour/mouse_cursors.h +++ b/gtk2_ardour/mouse_cursors.h @@ -79,7 +79,7 @@ public: is actually a valid value for a Gdk::Cursor - it indicates "use the parent window's cursor" */ - + static bool is_invalid (Gdk::Cursor* c) { if (!_invalid) { create_invalid(); } return c == _invalid; } static Gdk::Cursor* invalid_cursor() { if (!_invalid) { create_invalid(); } return _invalid; } diff --git a/gtk2_ardour/msvc/winmain.cc b/gtk2_ardour/msvc/winmain.cc index a9fe3d4224..85b847ea99 100644 --- a/gtk2_ardour/msvc/winmain.cc +++ b/gtk2_ardour/msvc/winmain.cc @@ -40,7 +40,7 @@ char* argv[256]; // Essential!! Make sure that any files used by Ardour // will be created or opened in BINARY mode! _fmode = O_BINARY; - + GetModuleFileName (NULL, (LPSTR)szPathToProgram, (DWORD)sizeof(szPathToProgram)); argv[0] = new char[(strlen(szPathToProgram) + 1)]; diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index c536bd29bb..a8c35f250f 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -64,11 +64,11 @@ OptionEditorComponent::add_widgets_to_page (OptionEditorPage* p, Gtk::Widget* wa if (!_note.empty ()) { ++m; } - + p->table.resize (m, 3); p->table.attach (*wa, 1, 2, n, n + 1, FILL); p->table.attach (*wb, 2, 3, n, n + 1, FILL | EXPAND); - + maybe_add_note (p, n + 1); } @@ -236,7 +236,7 @@ BoolComboOption::BoolComboOption ( _combo->append_text (f); /* and option 1 is the true */ _combo->append_text (t); - + _combo->signal_changed().connect (sigc::mem_fun (*this, &BoolComboOption::changed)); } @@ -263,9 +263,9 @@ BoolComboOption::set_sensitive (bool yn) { _combo->set_sensitive (yn); } - - + + FaderOption::FaderOption (string const & i, string const & n, sigc::slot g, sigc::slot s) : Option (i, n) , _db_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1) diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index 13b0285c32..67835b291a 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -78,7 +78,7 @@ public: private: void maybe_add_note (OptionEditorPage *, int); - + std::string _note; }; @@ -625,7 +625,7 @@ public: private: void selection_changed (); - + sigc::slot _get; ///< slot to get the configuration variable's value sigc::slot _set; ///< slot to set the configuration variable's value Gtk::FileChooserButton _file_chooser; @@ -654,13 +654,13 @@ public: void add_option (std::string const &, OptionEditorComponent *); void add_page (std::string const &, Gtk::Widget& page_widget); - + void set_current_page (std::string const &); protected: virtual void parameter_changed (std::string const &); - + PBD::Configuration* _config; private: diff --git a/gtk2_ardour/panner_interface.h b/gtk2_ardour/panner_interface.h index a18c083528..3e79c35536 100644 --- a/gtk2_ardour/panner_interface.h +++ b/gtk2_ardour/panner_interface.h @@ -45,7 +45,7 @@ public: private: bool _dragging; }; - + /** Parent class for some panner UI classes that contains some common code */ class PannerInterface : public Gtk::DrawingArea, public PBD::Destructible @@ -65,7 +65,7 @@ protected: virtual void set_tooltip () = 0; void value_change (); - + bool on_enter_notify_event (GdkEventCrossing *); bool on_leave_notify_event (GdkEventCrossing *); bool on_key_release_event (GdkEventKey *); diff --git a/gtk2_ardour/patch_change.cc b/gtk2_ardour/patch_change.cc index 96cd2f5ebc..c8d003f845 100644 --- a/gtk2_ardour/patch_change.cc +++ b/gtk2_ardour/patch_change.cc @@ -62,7 +62,7 @@ PatchChange::PatchChange(MidiRegionView& region, UIConfiguration::instance().color_mod ("midi patch change fill", "midi patch change fill"), ArdourCanvas::Duple (x, y), true); - + CANVAS_DEBUG_NAME (_flag, text); _flag->Event.connect (sigc::mem_fun (*this, &PatchChange::event_handler)); @@ -98,12 +98,12 @@ PatchChange::initialize_popup_menus() ++bank) { Glib::RefPtr underscores = Glib::Regex::create("_"); std::string replacement(" "); - + Gtk::Menu& patch_bank_menu = *manage(new Gtk::Menu()); - + const PatchNameList& patches = (*bank)->patch_name_list(); Gtk::Menu::MenuList& patch_menus = patch_bank_menu.items(); - + for (PatchNameList::const_iterator patch = patches.begin(); patch != patches.end(); ++patch) { @@ -131,13 +131,13 @@ PatchChange::initialize_popup_menus() const PatchNameList& patches = patch_banks.front()->patch_name_list(); Gtk::Menu::MenuList& patch_menus = _popup.items(); - + for (PatchNameList::const_iterator patch = patches.begin(); patch != patches.end(); ++patch) { std::string name = (*patch)->name(); boost::replace_all (name, "_", " "); - + patch_menus.push_back ( Gtk::Menu_Helpers::MenuElem ( name, @@ -158,7 +158,7 @@ PatchChange::event_handler (GdkEvent* ev) { /* XXX: icky dcast */ Editor* e = dynamic_cast (&_region.get_time_axis_view().editor()); - + if (!e->internal_editing()) { return false; } @@ -176,7 +176,7 @@ PatchChange::event_handler (GdkEvent* ev) _region.edit_patch_change (this); return true; - + } else if (ev->button.button == 1) { e->drags()->set (new PatchChangeDrag (e, this, &_region), ev); return true; diff --git a/gtk2_ardour/patch_change_dialog.cc b/gtk2_ardour/patch_change_dialog.cc index 519e0df240..1c0d824321 100644 --- a/gtk2_ardour/patch_change_dialog.cc +++ b/gtk2_ardour/patch_change_dialog.cc @@ -62,7 +62,7 @@ PatchChangeDialog::PatchChangeDialog ( int r = 0; if (_time_converter) { - + l = manage (left_aligned_label (_("Time"))); t->attach (*l, 0, 1, r, r + 1); t->attach (_time, 1, 2, r, r + 1); @@ -84,7 +84,7 @@ PatchChangeDialog::PatchChangeDialog ( t->attach (*l, 0, 1, r, r + 1); t->attach (_patch_combo, 1, 2, r, r + 1); ++r; - + _patch_combo.signal_changed().connect (sigc::mem_fun (*this, &PatchChangeDialog::patch_combo_changed)); l = manage (left_aligned_label (_("Channel"))); @@ -180,7 +180,7 @@ void PatchChangeDialog::set_active_bank_combo () { _current_patch_bank.reset (); - + boost::shared_ptr cns = _info.get_patches (_channel.get_value_as_int() - 1); if (!cns) { @@ -215,7 +215,7 @@ PatchChangeDialog::bank_combo_changed () if (_ignore_signals) { return; } - + _current_patch_bank.reset (); boost::shared_ptr cns = _info.get_patches (_channel.get_value_as_int() - 1); @@ -278,7 +278,7 @@ PatchChangeDialog::set_active_patch_combo () _ignore_signals = false; return; } - + const MIDI::Name::PatchNameList& patches = _current_patch_bank->patch_name_list (); for (MIDI::Name::PatchNameList::const_iterator j = patches.begin(); j != patches.end(); ++j) { string n = (*j)->name (); @@ -296,7 +296,7 @@ PatchChangeDialog::set_active_patch_combo () _ignore_signals = true; _patch_combo.set_active (-1); _ignore_signals = false; -} +} /** Set _program from the current state of _patch_combo */ void diff --git a/gtk2_ardour/piano_roll_header.cc b/gtk2_ardour/piano_roll_header.cc index 8b2e49770d..043f6c546e 100644 --- a/gtk2_ardour/piano_roll_header.cc +++ b/gtk2_ardour/piano_roll_header.cc @@ -467,7 +467,7 @@ PianoRollHeader::on_motion_notify_event (GdkEventMotion* ev) if (_dragging) { if ( false /*editor().current_mouse_mode() == Editing::MouseRange*/ ) { //ToDo: fix this. this mode is buggy, and of questionable utility anyway - + /* select note range */ if (Keyboard::no_modifiers_active (ev->state)) { @@ -480,9 +480,9 @@ PianoRollHeader::on_motion_notify_event (GdkEventMotion* ev) if (_clicked_note != NO_MIDI_NOTE && _clicked_note != note) { _active_notes[_clicked_note] = false; send_note_off(_clicked_note); - + _clicked_note = note; - + if (!_active_notes[note]) { _active_notes[note] = true; send_note_on(note); @@ -511,12 +511,12 @@ PianoRollHeader::on_button_press_event (GdkEventButton* ev) } else if (ev->button == 1 && note >= 0 && note < 128) { add_modal_grab(); _dragging = true; - + if (!_active_notes[note]) { _active_notes[note] = true; _clicked_note = note; send_note_on(note); - + invalidate_note_range(note, note); } else { reset_clicked_note(note); @@ -540,7 +540,7 @@ PianoRollHeader::on_button_release_event (GdkEventButton* ev) } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::RangeSelectModifier)) { ExtendNoteSelection (note); // EMIT SIGNAL } - + } else { if (_dragging) { diff --git a/gtk2_ardour/pingback.cc b/gtk2_ardour/pingback.cc index 35c90f4160..ecea85f657 100644 --- a/gtk2_ardour/pingback.cc +++ b/gtk2_ardour/pingback.cc @@ -112,7 +112,7 @@ _pingback (void *arg) curl_global_init (CURL_GLOBAL_NOTHING); c = curl_easy_init (); - + curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, curl_write_data); curl_easy_setopt (c, CURLOPT_WRITEDATA, &return_str); char errbuf[CURL_ERROR_SIZE]; @@ -219,7 +219,7 @@ _pingback (void *arg) std::cerr << "Announcement string is too long (probably behind a proxy)." << std::endl; } else { std::cerr << "Announcement is: " << return_str << std::endl; - + //write announcements to local file, even if the //announcement is empty diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc index cdc144d1b7..35a64f38dd 100644 --- a/gtk2_ardour/playlist_selector.cc +++ b/gtk2_ardour/playlist_selector.cc @@ -118,7 +118,7 @@ PlaylistSelector::show_for (RouteUI* ruix) for (TrackPlaylistMap::iterator x = trpl_map.begin(); x != trpl_map.end(); ++x) { boost::shared_ptr tr = boost::dynamic_pointer_cast (_session->route_by_id (x->first)); - + /* legacy sessions stored the diskstream ID as the original * playlist owner. so try there instead. */ diff --git a/gtk2_ardour/plugin_eq_gui.cc b/gtk2_ardour/plugin_eq_gui.cc index 35ba31eeb2..3115f54c41 100644 --- a/gtk2_ardour/plugin_eq_gui.cc +++ b/gtk2_ardour/plugin_eq_gui.cc @@ -330,7 +330,7 @@ PluginEqGui::run_impulse_analysis() { /* Allocate some thread-local buffers so that Plugin::connect_and_run can use them */ ARDOUR_UI::instance()->get_process_buffers (); - + uint32_t inputs = _plugin->get_info()->n_inputs.n_audio(); uint32_t outputs = _plugin->get_info()->n_outputs.n_audio(); diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index f2a6ae2a2d..8aff9c4252 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -65,7 +65,7 @@ PluginSelector::PluginSelector (PluginManager& mgr) : ArdourDialog (_("Plugin Manager"), true, false) , filter_button (Stock::CLEAR) , manager (mgr) - + { set_name ("PluginSelectorWindow"); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK); @@ -340,7 +340,7 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte newrow[plugin_columns.audio_ins] = buf; snprintf (buf, sizeof(buf), "%d", (*i)->n_inputs.n_midi()); newrow[plugin_columns.midi_ins] = buf; - + snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_audio()); newrow[plugin_columns.audio_outs] = buf; snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_midi()); diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index ed73e50b7c..37c01462b2 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -100,7 +100,7 @@ PluginUIWindow::PluginUIWindow ( case ARDOUR::Windows_VST: have_gui = create_windows_vst_editor (insert); break; - + case ARDOUR::LXVST: have_gui = create_lxvst_editor (insert); break; @@ -662,7 +662,7 @@ bool PlugUIBase::bypass_button_release (GdkEventButton*) { bool view_says_bypassed = (bypass_button.active_state() != 0); - + if (view_says_bypassed != insert->active()) { if (view_says_bypassed) { insert->activate (); @@ -712,7 +712,7 @@ PlugUIBase::toggle_description() description_expander.add(*label); description_expander.show_all(); } - + if (!description_expander.get_expanded()) { description_expander.remove(); } diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index 4aed3648c7..41f4ef39f1 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -145,7 +145,7 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL ArdourButton automation_write_all_button; /** a button which sets all controls' automation setting to Touch */ ArdourButton automation_touch_all_button; - + void set_latency_label (); LatencyGUI* latency_gui; diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index d41b5f1a06..b29e117f1f 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -450,7 +450,7 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t) sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i))); } } - + /* Now add other ones */ for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) { if (!should_show (*i)) { @@ -497,12 +497,12 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t) /* we're looking just at bundles, or our bundle has only one channel, so just offer to disassociate all on the bundle. */ - + snprintf (buf, sizeof (buf), _("%s all"), disassociation_verb().c_str()); sub.push_back ( MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::disassociate_all_on_bundle), w, dim)) ); - + } else if (c != 0) { if (bc[dim].channel != -1) { @@ -543,7 +543,7 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t) items.push_back (MenuElem (_("Flip"), sigc::mem_fun (*this, &PortMatrix::flip))); items.back().set_sensitive (can_flip ()); - + _menu->popup (1, t); } @@ -634,7 +634,7 @@ PortMatrix::setup_global_ports_proxy () /* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy for a discussion. */ - + Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports)); } @@ -935,7 +935,7 @@ PortMatrix::visible_ports (int d) const the TOP_TO_RIGHT arrangement we reverse the order of the vertical tabs in setup_notebooks (). */ - + int n = 0; if (d == _row_index) { if (_arrangement == LEFT_TO_BOTTOM) { @@ -1007,11 +1007,11 @@ PortMatrix::update_tab_highlighting () if (!_session) { return; } - + for (int i = 0; i < 2; ++i) { Gtk::Notebook* notebook = row_index() == i ? &_vnotebook : &_hnotebook; - + PortGroupList const * gl = ports (i); int p = 0; for (PortGroupList::List::const_iterator j = gl->begin(); j != gl->end(); ++j) { @@ -1166,7 +1166,7 @@ pair PortMatrix::check_flip () const { /* Look for the row's port group name in the columns */ - + int new_column = 0; boost::shared_ptr r = visible_ports (_row_index); PortGroupList::List::const_iterator i = _ports[_column_index].begin(); @@ -1180,7 +1180,7 @@ PortMatrix::check_flip () const } /* Look for the column's port group name in the rows */ - + int new_row = 0; boost::shared_ptr c = visible_ports (_column_index); i = _ports[_row_index].begin(); diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc index f2c4ce146c..cf591f8ff8 100644 --- a/gtk2_ardour/port_matrix_column_labels.cc +++ b/gtk2_ardour/port_matrix_column_labels.cc @@ -162,7 +162,7 @@ PortMatrixColumnLabels::render (cairo_t* cr) (*i)->bundle, (*i)->bundle->type_channel_to_overall (_matrix->type (), j) ); - + render_channel_name (cr, background_colour (), c, x, 0, bc); x += grid_spacing(); } @@ -504,7 +504,7 @@ PortMatrixColumnLabels::motion (double x, double y) if (!_matrix->should_show (w.bundle->channel_type (i))) { continue; } - + ARDOUR::BundleChannel const bc (w.bundle, i); n.push_back (PortMatrixNode (ARDOUR::BundleChannel (), bc)); } diff --git a/gtk2_ardour/port_matrix_grid.cc b/gtk2_ardour/port_matrix_grid.cc index 23fda6e484..77995489a3 100644 --- a/gtk2_ardour/port_matrix_grid.cc +++ b/gtk2_ardour/port_matrix_grid.cc @@ -137,7 +137,7 @@ PortMatrixGrid::render (cairo_t* cr) cairo_line_to (cr, _width, y); cairo_stroke (cr); } - + /* ASSOCIATION INDICATORS and NON-CONNECTABLE INDICATORS */ /* we draw a grey square in a matrix box if the two ports that intersect at that box @@ -230,7 +230,7 @@ PortMatrixGrid::render (cairo_t* cr) */ draw_non_connectable_indicator (cr, x, y); } - + x += grid_spacing(); } diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc index 8ed464954f..507e9fc254 100644 --- a/gtk2_ardour/port_matrix_row_labels.cc +++ b/gtk2_ardour/port_matrix_row_labels.cc @@ -123,7 +123,7 @@ PortMatrixRowLabels::render (cairo_t* cr) (*i)->bundle, (*i)->bundle->type_channel_to_overall (_matrix->type (), j) ); - + render_channel_name (cr, background_colour (), c, 0, y, bc); y += grid_spacing(); ++M; @@ -132,7 +132,7 @@ PortMatrixRowLabels::render (cairo_t* cr) if (N == 0) { y += grid_spacing (); } - + } else { y += grid_spacing(); } diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 63aa5aa765..b72fcbe276 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -118,7 +118,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr p = _processor->what_can_be_automated (); for (set::iterator i = p.begin(); i != p.end(); ++i) { - + std::string label = _processor->describe_parameter (*i); if (boost::dynamic_pointer_cast (_processor)) { @@ -165,7 +165,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptrautomation_control (*i), label); - + _controls.push_back (c); if (boost::dynamic_pointer_cast (_processor) == 0) { @@ -458,7 +458,7 @@ ProcessorEntry::build_controls_menu () items.push_back ( MenuElem (_("Show All Controls"), sigc::mem_fun (*this, &ProcessorEntry::show_all_controls)) ); - + items.push_back ( MenuElem (_("Hide All Controls"), sigc::mem_fun (*this, &ProcessorEntry::hide_all_controls)) ); @@ -466,7 +466,7 @@ ProcessorEntry::build_controls_menu () if (!_controls.empty ()) { items.push_back (SeparatorElem ()); } - + for (list::iterator i = _controls.begin(); i != _controls.end(); ++i) { items.push_back (CheckMenuElem ((*i)->name ())); Gtk::CheckMenuItem* c = dynamic_cast (&items.back ()); @@ -538,7 +538,7 @@ ProcessorEntry::Control::Control (boost::shared_ptr c, string //c->Changed.connect (_connection, MISSING_INVALIDATOR, boost::bind (&Control::control_changed, this), gui_context ()); } else { - + _slider.set_name ("ProcessorControlSlider"); _slider.set_text (_name); @@ -569,7 +569,7 @@ ProcessorEntry::Control::Control (boost::shared_ptr c, string _adjustment.set_step_increment (smallstep); _adjustment.set_page_increment (largestep); _slider.set_default_value (normal); - + _adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &Control::slider_adjusted)); // dup. currently timers are used :( //c->Changed.connect (_connection, MISSING_INVALIDATOR, boost::bind (&Control::control_changed, this), gui_context ()); @@ -578,7 +578,7 @@ ProcessorEntry::Control::Control (boost::shared_ptr c, string // yuck, do we really need to do this? // according to c404374 this is only needed for send automation timer_connection = Timers::rapid_connect (sigc::mem_fun (*this, &Control::control_changed)); - + control_changed (); set_tooltip (); @@ -617,7 +617,7 @@ ProcessorEntry::Control::slider_adjusted () if (_ignore_ui_adjustment) { return; } - + boost::shared_ptr c = _control.lock (); if (!c) { @@ -657,7 +657,7 @@ ProcessorEntry::Control::control_changed () if (c->toggled ()) { _button.set_active (c->get_value() > 0.5); - + } else { // as long as rapid timers are used, only update the tooltip // if the value has changed. @@ -667,7 +667,7 @@ ProcessorEntry::Control::control_changed () set_tooltip (); } } - + _ignore_ui_adjustment = false; } @@ -700,7 +700,7 @@ ProcessorEntry::Control::set_visible (bool v) } else { box.hide (); } - + _visible = v; } @@ -1343,7 +1343,7 @@ ProcessorBox::processor_operation (ProcessorOperation op) if ( (op == ProcessorsDelete) && targets.empty() ) return false; //nothing to delete. return false so the editor-mixer, because the user was probably intending to delete something in the editor - + switch (op) { case ProcessorsSelectAll: processor_display.select_all (); @@ -1398,7 +1398,7 @@ ProcessorBox::processor_operation (ProcessorOperation op) default: break; } - + return true; } @@ -1441,7 +1441,7 @@ ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry* } else if (Keyboard::is_context_menu_event (ev)) { show_processor_menu (ev->time); - + ret = true; } else if (processor && ev->button == 1 && selected) { @@ -1782,7 +1782,7 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr w) if (ui_xml) { wp->set_state (*ui_xml); } - + void* existing_ui = p->get_ui (); if (existing_ui) { @@ -1830,7 +1830,7 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr p) } boost::shared_ptr plugin_insert = boost::dynamic_pointer_cast (processor); - + ProcessorEntry* e = 0; if (plugin_insert) { e = new PluginInsertProcessorEntry (this, plugin_insert, _width); @@ -1841,7 +1841,7 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr p) boost::shared_ptr send = boost::dynamic_pointer_cast (processor); boost::shared_ptr ext = boost::dynamic_pointer_cast (processor); boost::shared_ptr stub = boost::dynamic_pointer_cast (processor); - + //faders and meters are not deletable, copy/paste-able, so they shouldn't be selectable if (!send && !plugin_insert && !ext && !stub) e->set_selectable(false); @@ -2220,11 +2220,11 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr continue; } else if (type->value() == "intsend") { - + /* aux sends are OK, but those used for * other purposes, are not. */ - + assert (role); if (role->value() != "Aux") { @@ -2253,7 +2253,7 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr Send* s = new Send (*_session, _route->pannable(), _route->mute_master()); IOProcessor::prepare_for_reset (n, s->name()); - + if (s->set_state (n, Stateful::loading_state_version)) { delete s; return; @@ -2279,13 +2279,13 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr XMLNode n (**niter); PortInsert* pi = new PortInsert (*_session, _route->pannable (), _route->mute_master ()); - + IOProcessor::prepare_for_reset (n, pi->name()); - + if (pi->set_state (n, Stateful::loading_state_version)) { return; } - + p.reset (pi); } else { @@ -3004,7 +3004,7 @@ ProcessorBox::entry_gui_object_state (ProcessorEntry* entry) } GUIObjectState& st = _parent_strip->gui_object_state (); - + XMLNode* strip = st.get_or_add_node (_parent_strip->state_id ()); assert (strip); return st.get_or_add_node (strip, entry->state_id()); @@ -3120,7 +3120,7 @@ ProcessorWindowProxy::get (bool create) if (!create) { return 0; } - + is_custom = want_custom; _window = _processor_box->get_editor_window (p, is_custom); diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index ce4a0e8851..18ec38a056 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -118,7 +118,7 @@ public: bool is_selectable() const {return _selectable;} void set_selectable(bool s) { _selectable = s; } - + enum Position { PreFader, Fader, @@ -183,7 +183,7 @@ private: std::string name () const { return _name; } - + Gtk::Alignment box; private: @@ -305,7 +305,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void generic_edit_processor (boost::shared_ptr); void update_gui_object_state (ProcessorEntry *); - + sigc::signal > ProcessorSelected; sigc::signal > ProcessorUnselected; diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 9b4566e1e4..bcf98dbac4 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -211,7 +211,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi virtual void set_show_measures (bool yn) = 0; virtual bool show_measures () const = 0; virtual void remove_tracks () = 0; - + virtual Editing::MouseMode effective_mouse_mode () const = 0; /** Import existing media */ @@ -471,7 +471,7 @@ public: */ ActionManager::disable_active_actions (); } - + ~MainMenuDisabler () { ActionManager::enable_active_actions (); } diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 9520c6eb88..f7ba164345 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -101,10 +101,10 @@ public: _click_emphasis_browse_button.signal_clicked ().connect ( sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked)); t->attach (_click_emphasis_browse_button, 2, 3, 2, 3, FILL); - + _box->pack_start (*t, false, false); - _click_path_entry.signal_activate().connect (sigc::mem_fun (*this, &ClickOptions::click_changed)); + _click_path_entry.signal_activate().connect (sigc::mem_fun (*this, &ClickOptions::click_changed)); _click_emphasis_path_entry.signal_activate().connect (sigc::mem_fun (*this, &ClickOptions::click_emphasis_changed)); if (_rc_config->get_click_sound ().empty() && @@ -155,7 +155,7 @@ private: { click_chosen (_click_path_entry.get_text ()); } - + void click_emphasis_browse_clicked () { SoundFileChooser sfdb (_("Choose Click Emphasis")); @@ -1077,7 +1077,7 @@ public: vector presets; /* these must match the order of the enums for BufferingPreset */ - + presets.push_back (_("Small sessions (4-16 tracks)")); presets.push_back (_("Medium sessions (16-64 tracks)")); presets.push_back (_("Large sessions (64+ tracks)")); @@ -1094,7 +1094,7 @@ public: _box->pack_start (*h, false, false); _buffering_presets_combo.signal_changed().connect (sigc::mem_fun (*this, &BufferingOptions::preset_changed)); - + _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds()); l = manage (new Label (_("Playback (seconds of buffering):"))); @@ -1192,7 +1192,7 @@ private: break; } } - + void playback_changed () { _rc_config->set_audio_playback_buffer_seconds ((long) _playback_adjustment.get_value()); @@ -1269,7 +1269,7 @@ private: void protocol_status_changed (ControlProtocolInfo* cpi) { /* find the row */ TreeModel::Children rows = _store->children(); - + for (TreeModel::Children::iterator x = rows.begin(); x != rows.end(); ++x) { string n = ((*x)[_model.name]); @@ -1785,7 +1785,7 @@ private: */ _set (_visibility_group->get_state_value ()); } - + OptionEditorHeading _heading; VisibilityGroup* _visibility_group; sigc::slot _get; @@ -1931,7 +1931,7 @@ RCOptionEditor::RCOptionEditor () (_("When enabled the loop button does not start playback but forces playback to always play the loop\n\n" "When disabled the loop button starts playing the loop, but stop then cancels loop playback"))); add_option (_("Transport"), tsf); - + tsf = new BoolOption ( "stop-recording-on-xrun", _("Stop recording when an xrun occurs"), @@ -2274,7 +2274,7 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_name_new_markers), sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_name_new_markers) ); - + add_option (_("Editor"), bo); Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(), _("If enabled, popup a dialog when a new marker is created to allow its name to be set as it is created." "\n\nYou can always rename markers by right-clicking on them")); @@ -2851,7 +2851,7 @@ RCOptionEditor::RCOptionEditor () (sics->tip_widget(), _("Increasing the cache size uses more memory to store waveform images, which can improve graphical performance.")); add_option (S_("Preferences|GUI"), sics); - + /* Lock GUI timeout */ Gtk::Adjustment *lts = manage (new Gtk::Adjustment(0, 0, 1000, 1, 10)); @@ -2876,7 +2876,7 @@ RCOptionEditor::RCOptionEditor () _mixer_strip_visibility.add (0, X_("SoloIsoLock"), _("Solo Iso / Lock")); _mixer_strip_visibility.add (0, X_("Output"), _("Output")); _mixer_strip_visibility.add (0, X_("Comments"), _("Comments")); - + add_option ( S_("Preferences|GUI"), new VisibilityOption ( diff --git a/gtk2_ardour/rc_option_editor.h b/gtk2_ardour/rc_option_editor.h index 95adee2115..879a9c4464 100644 --- a/gtk2_ardour/rc_option_editor.h +++ b/gtk2_ardour/rc_option_editor.h @@ -30,7 +30,7 @@ * are expressed using subclasses of Option. More complex UI elements are represented * using individual classes subclassed from OptionEditorBox. */ - + /** Editor for options which are obtained from and written back to one of the .rc files. */ class RCOptionEditor : public OptionEditor { diff --git a/gtk2_ardour/region_layering_order_editor.cc b/gtk2_ardour/region_layering_order_editor.cc index 7a1a2c2140..759b69fae1 100644 --- a/gtk2_ardour/region_layering_order_editor.cc +++ b/gtk2_ardour/region_layering_order_editor.cc @@ -107,7 +107,7 @@ RegionLayeringOrderEditor::RegionLayeringOrderEditor (PublicEditor& pe) RegionLayeringOrderEditor::~RegionLayeringOrderEditor () { - + } void @@ -123,15 +123,15 @@ RegionLayeringOrderEditor::row_selected () if (!iter) { return; } - + TreeModel::Row row = *iter; RegionView* rv = row[layering_order_columns.region_view]; - + vector eq; editor.get_equivalent_regions (rv, eq, Properties::select.property_id); /* XXX this should be reversible, really */ - + for (vector::iterator i = eq.begin(); i != eq.end(); ++i) { boost::shared_ptr pl = (*i)->region()->playlist(); if (pl) { @@ -150,7 +150,7 @@ void RegionLayeringOrderEditor::refill () { assert (_time_axis_view); - + regions_at_position = 0; in_row_change = true; layering_order_model->clear (); diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index aeede86bb6..7ddca8b574 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -159,14 +159,14 @@ RegionView::init (bool wfd) name_highlight->set_data ("regionview", this); name_highlight->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_highlight_event), name_highlight, this)); } - + if (frame_handle_start) { frame_handle_start->set_data ("regionview", this); frame_handle_start->set_data ("isleft", (void*) 1); frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_start, this)); frame_handle_start->raise_to_top(); } - + if (frame_handle_end) { frame_handle_end->set_data ("regionview", this); frame_handle_end->set_data ("isleft", (void*) 0); @@ -531,7 +531,7 @@ RegionView::get_fill_color () const { ArdourCanvas::Color f = TimeAxisViewItem::get_fill_color(); char const *modname; - + if (_region->opaque()) { modname = "opaque region base"; } else { @@ -684,7 +684,7 @@ RegionView::move (double x_delta, double y_delta) */ ArdourCanvas::Item *item = get_canvas_group (); - + if (item->position().x + x_delta < 0) { x_delta = -item->position().x; /* move it to zero */ } diff --git a/gtk2_ardour/route_group_dialog.cc b/gtk2_ardour/route_group_dialog.cc index e7e48f777e..aa381d3c47 100644 --- a/gtk2_ardour/route_group_dialog.cc +++ b/gtk2_ardour/route_group_dialog.cc @@ -85,7 +85,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new) hbox->pack_start (*l, false, false); hbox->pack_start (_color, false, false); top_vbox->pack_start (*hbox, false, false); - + main_vbox->pack_start (*top_vbox, false, false); _active.set_active (_group->is_active ()); @@ -96,7 +96,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new) VBox* options_box = manage (new VBox); options_box->set_spacing (6); - + l = manage (new Label (_("Sharing"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false )); l->set_use_markup (); options_box->pack_start (*l, false, true); @@ -135,7 +135,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new) _route_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); _share_color.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); _share_monitoring.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update)); - + gain_toggled (); Table* table = manage (new Table (11, 4, false)); @@ -229,7 +229,7 @@ RouteGroupDialog::update () plist.add (Properties::monitoring, _share_monitoring.get_active()); _group->apply_changes (plist); - + GroupTabs::set_group_color (_group, gdk_color_to_rgba (_color.get_color ())); } diff --git a/gtk2_ardour/route_processor_selection.cc b/gtk2_ardour/route_processor_selection.cc index 8975bf90bc..30943e22d0 100644 --- a/gtk2_ardour/route_processor_selection.cc +++ b/gtk2_ardour/route_processor_selection.cc @@ -105,11 +105,11 @@ RouteProcessorSelection::add (RouteUI* r) r->set_selected (true); MixerStrip* ms = dynamic_cast (r); - + if (ms) { ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1), gui_context()); } - + if (!_no_route_change_signal) { RoutesChanged(); } diff --git a/gtk2_ardour/route_sorter.h b/gtk2_ardour/route_sorter.h index 768eac66f3..c203afa188 100644 --- a/gtk2_ardour/route_sorter.h +++ b/gtk2_ardour/route_sorter.h @@ -38,7 +38,7 @@ struct RoutePlusOrderKey { , old_display_order (ok) , new_display_order (nk) {} }; - + typedef std::vector OrderKeySortedRoutes; struct SortByNewDisplayOrder { diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 57c2cd791f..5a1585289c 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -189,7 +189,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) } rec_enable_button->set_sensitive (_session->writable()); - + /* set playlist button tip to the current playlist, and make it update when it changes */ update_playlist_tip (); track()->PlaylistChanged.connect (*this, invalidator (*this), ui_bind(&RouteTimeAxisView::update_playlist_tip, this), gui_context()); @@ -251,7 +251,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) controls_table.attach (route_group_button, 4, 5, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0); controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 1, 0); } - + set_tooltip(*solo_button,_("Solo")); set_tooltip(*mute_button,_("Mute")); set_tooltip(route_group_button, _("Route Group")); @@ -324,7 +324,7 @@ RouteTimeAxisView::set_route (boost::shared_ptr rt) RouteTimeAxisView::~RouteTimeAxisView () { cleanup_gui_properties (); - + for (list::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) { delete *i; } @@ -507,7 +507,7 @@ RouteTimeAxisView::build_automation_action_menu (bool for_selection) /* Attach the plugin submenu. It may have previously been used elsewhere, so it was detached above */ - + if (!subplugin_menu.items().empty()) { items.push_back (SeparatorElem ()); items.push_back (MenuElem (_("Processor automation"), subplugin_menu)); @@ -634,7 +634,7 @@ RouteTimeAxisView::build_display_menu () */ _ignore_set_layer_display = true; - + layers_items.push_back (RadioMenuElem (layers_group, _("Overlaid"))); RadioMenuItem* i = dynamic_cast (&layers_items.back ()); i->set_active (overlaid != 0 && stacked == 0); @@ -646,7 +646,7 @@ RouteTimeAxisView::build_display_menu () i->set_active (overlaid == 0 && stacked != 0); i->set_inconsistent (overlaid != 0 && stacked != 0); i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::set_layer_display), Stacked, true)); - + _ignore_set_layer_display = false; items.push_back (MenuElem (_("Layers"), *layers_menu)); @@ -813,7 +813,7 @@ RouteTimeAxisView::build_display_menu () } route_group_menu->detach (); - + WeakRouteList r; for (TrackSelection::iterator i = _editor.get_selection().tracks.begin(); i != _editor.get_selection().tracks.end(); ++i) { RouteTimeAxisView* rtv = dynamic_cast (*i); @@ -821,19 +821,19 @@ RouteTimeAxisView::build_display_menu () r.push_back (rtv->route ()); } } - + if (r.empty ()) { r.push_back (route ()); } route_group_menu->build (r); items.push_back (MenuElem (_("Group"), *route_group_menu->menu ())); - + build_automation_action_menu (true); items.push_back (MenuElem (_("Automation"), *automation_action_menu)); - + items.push_back (SeparatorElem()); - + int active = 0; int inactive = 0; TrackSelection const & s = _editor.get_selection().tracks; @@ -1550,11 +1550,11 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op) vector cmds; playlist->rdiff (cmds); _session->add_commands (cmds); - + _session->add_command (new StatefulDiffCommand (playlist)); } break; - + case Cut: if ((what_we_got = playlist->cut (time)) != 0) { _editor.get_cut_buffer().add (what_we_got); @@ -1727,29 +1727,29 @@ RouteTimeAxisView::use_playlist (RadioMenuItem *item, boost::weak_ptr } track()->use_playlist (pl); - + RouteGroup* rg = route_group(); - + if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::select.property_id)) { std::string group_string = "." + rg->name() + "."; - + std::string take_name = pl->name(); std::string::size_type idx = take_name.find(group_string); - + if (idx == std::string::npos) return; - + take_name = take_name.substr(idx + group_string.length()); // find the bit containing the take number / name - + boost::shared_ptr rl (rg->route_list()); - + for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) { if ((*i) == this->route()) { continue; } std::string playlist_name = (*i)->name()+group_string+take_name; - + boost::shared_ptr track = boost::dynamic_pointer_cast(*i); if (!track) { continue; @@ -1759,7 +1759,7 @@ RouteTimeAxisView::use_playlist (RadioMenuItem *item, boost::weak_ptr /* Don't change playlists of frozen tracks */ continue; } - + boost::shared_ptr ipl = session()->playlists->by_name(playlist_name); if (!ipl) { // No playlist for this track for this take yet, make it @@ -1778,10 +1778,10 @@ RouteTimeAxisView::update_playlist_tip () RouteGroup* rg = route_group (); if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::select.property_id)) { string group_string = "." + rg->name() + "."; - + string take_name = track()->playlist()->name(); string::size_type idx = take_name.find(group_string); - + if (idx != string::npos) { /* find the bit containing the take number / name */ take_name = take_name.substr (idx + group_string.length()); @@ -1793,7 +1793,7 @@ RouteTimeAxisView::update_playlist_tip () Glib::Markup::escape_text(rg->name()), Glib::Markup::escape_text(take_name)) ); - + return; } } @@ -2209,7 +2209,7 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr boost::shared_ptr control = boost::dynamic_pointer_cast(processor->control(what, true)); - + pan->view = boost::shared_ptr( new AutomationTimeAxisView (_session, _route, processor, control, control->parameter (), _editor, *this, false, parent_canvas, @@ -2251,7 +2251,7 @@ RouteTimeAxisView::add_existing_processor_automation_curves (boost::weak_ptrwhat_has_data (existing); for (set::iterator i = existing.begin(); i != existing.end(); ++i) { - + Evoral::Parameter param (*i); boost::shared_ptr al; @@ -2365,7 +2365,7 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr p items.push_back (CheckMenuElem (name)); mitem = dynamic_cast (&items.back()); - + _subplugin_menu_map[*i] = mitem; if (has_visible_automation.find((*i)) != has_visible_automation.end()) { @@ -2414,7 +2414,7 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto if (pan->view && pan->view->set_marked_for_display (showit)) { redraw = true; } - + if (redraw && !no_redraw) { request_redraw (); } @@ -2503,7 +2503,7 @@ RouteTimeAxisView::set_layer_display (LayerDisplay d, bool apply_to_selection) if (_ignore_set_layer_display) { return; } - + if (apply_to_selection) { _editor.get_selection().tracks.foreach_route_time_axis (boost::bind (&RouteTimeAxisView::set_layer_display, _1, d, false)); } else { @@ -2909,7 +2909,7 @@ void RouteTimeAxisView::remove_child (boost::shared_ptr c) { TimeAxisView::remove_child (c); - + boost::shared_ptr a = boost::dynamic_pointer_cast (c); if (a) { for (AutomationTracks::iterator i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) { diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 0d9ed1a958..b05877346f 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -103,7 +103,7 @@ RouteUI::~RouteUI() delete input_selector; delete output_selector; delete _invert_menu; - + send_blink_connection.disconnect (); rec_blink_connection.disconnect (); } @@ -165,7 +165,7 @@ RouteUI::init () monitor_input_button->set_text (_("In")); UI::instance()->set_tip (monitor_input_button, _("Monitor input"), ""); monitor_input_button->set_no_show_all (true); - + monitor_disk_button = manage (new ArdourButton (ArdourButton::default_elements)); monitor_disk_button->set_name ("monitor button"); monitor_disk_button->set_text (_("Disk")); @@ -189,7 +189,7 @@ RouteUI::init () solo_button->signal_button_release_event().connect (sigc::mem_fun(*this, &RouteUI::solo_release), false); mute_button->signal_button_press_event().connect (sigc::mem_fun(*this, &RouteUI::mute_press), false); mute_button->signal_button_release_event().connect (sigc::mem_fun(*this, &RouteUI::mute_release), false); - + monitor_input_button->set_distinct_led_click (false); monitor_disk_button->set_distinct_led_click (false); @@ -270,7 +270,7 @@ RouteUI::set_route (boost::shared_ptr rp) boost::shared_ptr t = boost::dynamic_pointer_cast(_route); t->RecordEnableChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_rec_enable_changed, this), gui_context()); - + rec_enable_button->show(); rec_enable_button->set_controllable (t->rec_enable_control()); @@ -341,7 +341,7 @@ RouteUI::mute_press (GdkEventButton* ev) //if this is a binding action, let the ArdourButton handle it if ( BindingProxy::is_bind_action(ev) ) return false; - + multiple_mute_change = false; if (Keyboard::is_context_menu_event (ev)) { @@ -351,7 +351,7 @@ RouteUI::mute_press (GdkEventButton* ev) } mute_menu->popup(0,ev->time); - + return true; } else { @@ -373,7 +373,7 @@ RouteUI::mute_press (GdkEventButton* ev) * elements of the list we need to work * on a copy. */ - + boost::shared_ptr copy (new RouteList); *copy = *_session->get_routes (); @@ -404,9 +404,9 @@ RouteUI::mute_press (GdkEventButton* ev) if (ev->button == 1) { if (_route->route_group()) { - + rl = _route->route_group()->route_list(); - + if (_mute_release) { _mute_release->routes = rl; } @@ -425,7 +425,7 @@ RouteUI::mute_press (GdkEventButton* ev) boost::shared_ptr rl (new RouteList); rl->push_back (_route); - + if (_mute_release) { _mute_release->routes = rl; } @@ -510,7 +510,7 @@ RouteUI::solo_press(GdkEventButton* ev) //if this is a binding action, let the ArdourButton handle it if ( BindingProxy::is_bind_action(ev) ) return false; - + multiple_solo_change = false; if (Keyboard::is_context_menu_event (ev)) { @@ -598,9 +598,9 @@ RouteUI::solo_press(GdkEventButton* ev) if (ev->button == 1) { if (_route->route_group()) { - + rl = _route->route_group()->route_list(); - + if (_solo_release) { _solo_release->routes = rl; } @@ -674,7 +674,7 @@ RouteUI::rec_enable_press(GdkEventButton* ev) //if this is a binding action, let the ArdourButton handle it if ( BindingProxy::is_bind_action(ev) ) return false; - + if (!_session->engine().connected()) { MessageDialog msg (_("Not connected to AudioEngine - cannot engage record")); msg.run (); @@ -694,7 +694,7 @@ RouteUI::rec_enable_press(GdkEventButton* ev) if (is_track() && rec_enable_button) { if (Keyboard::is_button2_event (ev)) { - + //rec arm does not have a momentary mode return false; @@ -712,11 +712,11 @@ RouteUI::rec_enable_press(GdkEventButton* ev) if (ev->button == 1) { boost::shared_ptr rl; - + if (_route->route_group()) { - + rl = _route->route_group()->route_list(); - + } else { rl.reset (new RouteList); rl->push_back (_route); @@ -810,7 +810,7 @@ RouteUI::monitor_disk_release (GdkEventButton* ev) bool RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice) -{ +{ if (ev->button != 1) { return false; } @@ -823,7 +823,7 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice) MonitorChoice mc; boost::shared_ptr rl; - + /* XXX for now, monitoring choices are orthogonal. cue monitoring will follow in 3.X but requires mixing the input and playback (disk) signal together, which requires yet more buffers. @@ -837,7 +837,7 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice) mc = monitor_choice; } - if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { + if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) { rl = _session->get_routes (); } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { @@ -853,7 +853,7 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice) } DisplaySuspender ds; - _session->set_monitoring (rl, mc, Session::rt_cleanup, true); + _session->set_monitoring (rl, mc, Session::rt_cleanup, true); return false; } @@ -1532,11 +1532,11 @@ RouteUI::set_color (const Gdk::Color & c) char buf[64]; _color = c; snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue()); - + /* note: we use the route state ID here so that color is the same for both the time axis view and the mixer strip */ - + gui_object_state().set_property (route_state_id(), X_("color"), buf); _route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */ } @@ -1575,12 +1575,12 @@ RouteUI::verify_new_route_name (const std::string& name) if (name.find (':') == string::npos) { return true; } - + MessageDialog colon_msg ( _("The use of colons (':') is discouraged in track and bus names.\nDo you want to use this new name?"), false, MESSAGE_QUESTION, BUTTONS_NONE ); - + colon_msg.add_button (_("Use the new name"), Gtk::RESPONSE_ACCEPT); colon_msg.add_button (_("Re-edit the name"), Gtk::RESPONSE_CANCEL); @@ -1939,7 +1939,7 @@ RouteUI::open_remote_control_id_dialog () if (Config->get_remote_model() == UserOrdered) { uint32_t const limit = _session->ntracks() + _session->nbusses () + 4; - + HBox* hbox = manage (new HBox); hbox->set_spacing (6); hbox->pack_start (*manage (new Label (_("Remote control ID:")))); @@ -1950,7 +1950,7 @@ RouteUI::open_remote_control_id_dialog () spin->set_value (_route->remote_control_id()); hbox->pack_start (*spin); dialog.get_vbox()->pack_start (*hbox); - + dialog.add_button (Stock::CANCEL, RESPONSE_CANCEL); dialog.add_button (Stock::APPLY, RESPONSE_ACCEPT); } else { @@ -2043,7 +2043,7 @@ RouteUI::set_invert_button_state () */ ArdourButton* b = _invert_buttons.front (); - + if (_route->phase_invert().count() == _route->phase_invert().size()) { b->set_active_state (Gtkmm2ext::ExplicitActive); } else if (_route->phase_invert().any()) { @@ -2060,7 +2060,7 @@ RouteUI::set_invert_button_state () for (vector::iterator i = _invert_buttons.begin(); i != _invert_buttons.end(); ++i, ++j) { (*i)->set_active (_route->phase_invert (j)); } - + } } @@ -2092,7 +2092,7 @@ RouteUI::invert_press (GdkEventButton* ev) */ return false; } - + delete _invert_menu; _invert_menu = new Menu; _invert_menu->set_name ("ArdourContextMenu"); @@ -2171,7 +2171,7 @@ Gdk::Color RouteUI::color () const { RouteGroup* g = _route->route_group (); - + if (g && g->is_color()) { Gdk::Color c; set_color_from_rgba (c, GroupTabs::group_color (g)); diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 98d66fef84..7bc434f37f 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -304,7 +304,7 @@ class RouteUI : public virtual AxisView static void set_showing_sends_to (boost::shared_ptr); static boost::weak_ptr _showing_sends_to; - + static uint32_t _max_invert_buttons; }; diff --git a/gtk2_ardour/save_as_dialog.cc b/gtk2_ardour/save_as_dialog.cc index bb4f3de2c8..9c8d3cb734 100644 --- a/gtk2_ardour/save_as_dialog.cc +++ b/gtk2_ardour/save_as_dialog.cc @@ -39,7 +39,7 @@ SaveAsDialog::SaveAsDialog () VBox* vbox = get_vbox(); vbox->set_spacing (6); - + HBox* hbox; Label* label; @@ -62,7 +62,7 @@ SaveAsDialog::SaveAsDialog () VBox* sub_vbox = manage (new VBox); HBox* sub_hbox = manage (new HBox); HBox* empty = manage (new HBox); - + sub_vbox->pack_start (copy_media_button, false, false); sub_vbox->pack_start (copy_external_button, false, false); @@ -73,17 +73,17 @@ SaveAsDialog::SaveAsDialog () vbox->pack_start (no_include_media_button, false, false); vbox->pack_start (*sub_hbox, false, false); - + switch_to_button.set_active (true); copy_media_button.set_active (true); - + vbox->show_all (); add_button (Stock::CANCEL, RESPONSE_CANCEL); add_button (Stock::OK, RESPONSE_OK); no_include_media_button.signal_toggled ().connect (sigc::mem_fun (*this, &SaveAsDialog::no_include_toggled)); - + new_parent_folder_selector.set_action (FILE_CHOOSER_ACTION_SELECT_FOLDER); new_parent_folder_selector.set_current_folder (Glib::get_home_dir()); // Why $HOME and not poor_mans_glob (Config->get_default_session_parent_dir ()) ?? new_name_entry.signal_changed().connect (sigc::mem_fun (*this, &SaveAsDialog::name_entry_changed)); diff --git a/gtk2_ardour/save_as_dialog.h b/gtk2_ardour/save_as_dialog.h index f016aaf2cd..5284bea74d 100644 --- a/gtk2_ardour/save_as_dialog.h +++ b/gtk2_ardour/save_as_dialog.h @@ -33,7 +33,7 @@ public: std::string new_parent_folder () const; std::string new_name () const; - + bool switch_to () const; bool include_media () const; bool copy_media () const; @@ -41,7 +41,7 @@ public: void clear_name (); void set_name (std::string); - + private: Gtk::CheckButton switch_to_button; Gtk::CheckButton copy_media_button; diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc index f5f37aaa0c..1eb846b9ff 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -99,19 +99,19 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name, get_vbox()->pack_start (info_frame, false, false); setup_new_session_page (); - + if (!new_only) { setup_initial_choice_box (); get_vbox()->pack_start (ic_vbox, true, true); } else { get_vbox()->pack_start (session_new_vbox, true, true); } - + if (!template_name.empty()) { use_template_button.set_active (false); load_template_override = template_name; } - + get_vbox()->show_all (); /* fill data models and show/hide accordingly */ @@ -131,7 +131,7 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name, if (cnt > 0) { recent_scroller.show(); recent_label.show (); - + if (cnt > 4) { recent_scroller.set_size_request (-1, 300); } @@ -240,7 +240,7 @@ SessionDialog::session_name (bool& should_be_new) /* Try recent session selection */ TreeIter iter = recent_session_display.get_selection()->get_selected(); - + if (iter) { should_be_new = false; return (*iter)[recent_session_columns.visible_name]; @@ -266,9 +266,9 @@ SessionDialog::session_folder () } /* Try recent session selection */ - + TreeIter iter = recent_session_display.get_selection()->get_selected(); - + if (iter) { string s = (*iter)[recent_session_columns.fullpath]; if (Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) { @@ -342,10 +342,10 @@ SessionDialog::setup_initial_choice_box () hbox->pack_start (*image, false, false); } } - + vbox->pack_start (ic_new_session_button, true, true, 20); hbox->pack_start (*vbox, true, true, 20); - + centering_vbox->pack_start (*hbox, false, false); /* Possible update message */ @@ -380,29 +380,29 @@ SessionDialog::setup_initial_choice_box () recent_scroller.set_no_show_all (true); recent_label.set_markup (string_compose ("%1", _("Recent Sessions"))); - + centering_vbox->pack_start (recent_label, false, false, 12); centering_vbox->pack_start (recent_scroller, true, true); /* Browse button */ - + existing_session_chooser.set_title (_("Select session file")); existing_session_chooser.signal_file_set().connect (sigc::mem_fun (*this, &SessionDialog::existing_session_selected)); existing_session_chooser.set_current_folder(poor_mans_glob (Config->get_default_session_parent_dir())); - + FileFilter session_filter; session_filter.add_pattern (string_compose(X_("*%1"), ARDOUR::statefile_suffix)); session_filter.set_name (string_compose (_("%1 sessions"), PROGRAM_NAME)); existing_session_chooser.add_filter (session_filter); existing_session_chooser.set_filter (session_filter); - + #ifdef GTKOSX existing_session_chooser.add_shortcut_folder ("/Volumes"); #endif - + Label* browse_label = manage (new Label); browse_label->set_markup (string_compose ("%1", _("Other Sessions"))); - + centering_vbox->pack_start (*browse_label, false, false, 12); centering_vbox->pack_start (existing_session_chooser, false, false); @@ -544,7 +544,7 @@ SessionDialog::setup_new_session_page () #endif vbox1->pack_start (*hbox2, false, false); - + session_new_vbox.pack_start (*vbox1, false, false); /* --- */ @@ -567,20 +567,20 @@ SessionDialog::setup_new_session_page () HBox* hbox4a = manage (new HBox); use_template_button.set_label (_("Use this template")); - + TreeModel::Row row = *template_model->prepend (); row[session_template_columns.name] = (_("no template")); row[session_template_columns.path] = string(); - + hbox4a->set_spacing (6); hbox4a->pack_start (use_template_button, false, false); hbox4a->pack_start (template_chooser, true, true); - + template_chooser.set_model (template_model); - + Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText); text_renderer->property_editable() = false; - + template_chooser.pack_start (*text_renderer); template_chooser.add_attribute (text_renderer->property_text(), session_template_columns.name); template_chooser.set_active (0); @@ -588,21 +588,21 @@ SessionDialog::setup_new_session_page () vbox3->pack_start (*hbox4a, false, false); /* --- */ - + HBox* hbox5 = manage (new HBox); - + hbox5->set_spacing (6); hbox5->pack_start (more_new_session_options_button, false, false); - + setup_more_options_box (); more_new_session_options_button.add (more_options_vbox); - + vbox3->pack_start (*hbox5, false, false); hbox3->pack_start (*vbox3, true, true, 8); vbox2->pack_start (*hbox3, false, false); - + /* --- */ - + session_new_vbox.pack_start (*vbox2, false, false); session_new_vbox.show_all (); } @@ -647,7 +647,7 @@ SessionDialog::redisplay_recent_sessions () for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) { session_directories.push_back ((*i).second); } - + int session_snapshot_count = 0; for (vector::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i) @@ -737,7 +737,7 @@ SessionDialog::redisplay_recent_sessions () s = Glib::build_filename (dirname, *i2 + statefile_suffix); Gtk::TreeModel::Row child_row = *(recent_session_model->append (row.children())); - + child_row[recent_session_columns.visible_name] = *i2; child_row[recent_session_columns.fullpath] = s; child_row[recent_session_columns.tip] = Glib::Markup::escape_text (dirname); @@ -750,7 +750,7 @@ SessionDialog::redisplay_recent_sessions () if (gsb.st_mtime > most_recent) { most_recent = gsb.st_mtime; } - + if (Session::get_info_from_path (s, sr, sf) == 0) { child_row[recent_session_columns.sample_rate] = rate_as_string (sr); switch (sf) { diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc index 769a94b6d7..fa02278752 100644 --- a/gtk2_ardour/session_option_editor.cc +++ b/gtk2_ardour/session_option_editor.cc @@ -196,7 +196,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s) hf->add (BWF, _("Broadcast WAVE (4GB size limit)")); #ifdef HAVE_RF64_RIFF hf->add (MBWF, _("Broadcast RF64")); -#endif +#endif hf->add (WAVE, _("WAVE (4GB size limit)")); hf->add (WAVE64, _("WAVE-64")); hf->add (CAF, _("CAF")); diff --git a/gtk2_ardour/sfdb_freesound_mootcher.cc b/gtk2_ardour/sfdb_freesound_mootcher.cc index ebd165186d..586ad09ddd 100644 --- a/gtk2_ardour/sfdb_freesound_mootcher.cc +++ b/gtk2_ardour/sfdb_freesound_mootcher.cc @@ -100,7 +100,7 @@ void Mootcher::ensureWorkingDir () } #endif } - + //------------------------------------------------------------------------ size_t Mootcher::WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) @@ -127,7 +127,7 @@ std::string Mootcher::sortMethodString(enum sortMethod sort) // sort the results in the requested way. switch (sort) { - case sort_duration_desc: return "duration_desc"; + case sort_duration_desc: return "duration_desc"; case sort_duration_asc: return "duration_asc"; case sort_created_desc: return "created_desc"; case sort_created_asc: return "created_asc"; @@ -135,7 +135,7 @@ std::string Mootcher::sortMethodString(enum sortMethod sort) case sort_downloads_asc: return "downloads_asc"; case sort_rating_desc: return "rating_desc"; case sort_rating_asc: return "rating_asc"; - default: return ""; + default: return ""; } } @@ -150,7 +150,7 @@ void Mootcher::setcUrlOptions() curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer); // Allow redirection curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - + // Allow connections to time out (without using signals) curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30); @@ -180,9 +180,9 @@ std::string Mootcher::doRequest(std::string uri, std::string params) } else { url += "api_key=" + api_key + "&format=xml"; } - + curl_easy_setopt(curl, CURLOPT_URL, url.c_str() ); - + // perform online request CURLcode res = curl_easy_perform(curl); if( res != 0 ) { @@ -194,7 +194,7 @@ std::string Mootcher::doRequest(std::string uri, std::string params) if (xml_page.memory) { result = xml_page.memory; } - + free (xml_page.memory); xml_page.memory = NULL; xml_page.size = 0; @@ -234,7 +234,7 @@ std::string Mootcher::searchText(std::string query, int page, std::string filter params += "&f=" + std::string(ef); free(ef); } - + if (sort) params += "&s=" + sortMethodString(sort); @@ -317,7 +317,7 @@ CURLcode res; res = curl_easy_perform (curl); fclose (theFile); curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1); // turn off the progress bar - + if (res != CURLE_OK) { /* it's not an error if the user pressed the stop button */ if (res != CURLE_ABORTED_BY_CALLBACK) { @@ -373,7 +373,7 @@ bool Mootcher::checkAudioFile(std::string originalFileName, std::string theID) fclose (testFile); return true; } - + // else file was small, probably an error, delete it fclose(testFile); remove( audioFileName.c_str() ); @@ -397,7 +397,7 @@ bool Mootcher::fetchAudioFile(std::string originalFileName, std::string theID, s if (!theFile) { return false; } - + // create the download url audioURL += "?api_key=" + api_key; @@ -453,7 +453,7 @@ Mootcher::progress_callback(void *caller, double dltotal, double dlnow, double / // and we want access to some private members of Mootcher. Mootcher *thisMootcher = (Mootcher *) caller; - + if (thisMootcher->cancel_download) { return -1; } diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 3bfb74884e..6f6912abc9 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -576,19 +576,19 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi //add the file chooser chooser.set_border_width (12); - + audio_and_midi_filter.add_custom (FILE_FILTER_FILENAME, sigc::mem_fun (*this, &SoundFileBrowser::on_audio_and_midi_filter)); audio_and_midi_filter.set_name (_("Audio and MIDI files")); - + audio_filter.add_custom (FILE_FILTER_FILENAME, sigc::mem_fun(*this, &SoundFileBrowser::on_audio_filter)); audio_filter.set_name (_("Audio files")); - + midi_filter.add_custom (FILE_FILTER_FILENAME, sigc::mem_fun(*this, &SoundFileBrowser::on_midi_filter)); midi_filter.set_name (_("MIDI files")); - + matchall_filter.add_pattern ("*.*"); matchall_filter.set_name (_("All files")); - + chooser.add_filter (audio_and_midi_filter); chooser.add_filter (audio_filter); chooser.add_filter (midi_filter); @@ -601,13 +601,13 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi /* some broken redraw behaviour - this is a bandaid */ chooser.signal_selection_changed().connect (mem_fun (chooser, &Widget::queue_draw)); #endif - + if (!persistent_folder.empty()) { chooser.set_current_folder (persistent_folder); } notebook.append_page (chooser, _("Browse Files")); - + hpacker.set_spacing (6); hpacker.pack_start (notebook, true, true); hpacker.pack_start (preview, false, false); @@ -621,52 +621,52 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi VBox* vbox; HBox* hbox; - - + + hbox = manage(new HBox); hbox->pack_start (found_entry); hbox->pack_start (found_search_btn); - + Gtk::ScrolledWindow *scroll = manage(new ScrolledWindow); scroll->add(found_list_view); scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - + vbox = manage(new VBox); vbox->pack_start (*hbox, PACK_SHRINK); vbox->pack_start (*scroll); - + found_list_view.append_column(_("Paths"), found_list_columns.pathname); - + found_list_view.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SoundFileBrowser::found_list_view_selected)); - + found_list_view.signal_row_activated().connect (sigc::mem_fun (*this, &SoundFileBrowser::found_list_view_activated)); - + found_search_btn.signal_clicked().connect(sigc::mem_fun(*this, &SoundFileBrowser::found_search_clicked)); found_entry.signal_activate().connect(sigc::mem_fun(*this, &SoundFileBrowser::found_search_clicked)); - + notebook.append_page (*vbox, _("Search Tags")); //add freesound search HBox* passbox; Label* label; - + passbox = manage(new HBox); passbox->set_spacing (6); - + label = manage (new Label); label->set_text (_("Tags:")); passbox->pack_start (*label, false, false); passbox->pack_start (freesound_entry, true, true); - + label = manage (new Label); label->set_text (_("Sort:")); passbox->pack_start (*label, false, false); passbox->pack_start (freesound_sort, false, false); freesound_sort.clear_items(); - + // Order of the following must correspond with enum sortMethod - // in sfdb_freesound_mootcher.h + // in sfdb_freesound_mootcher.h freesound_sort.append_text(_("None")); freesound_sort.append_text(_("Longest")); freesound_sort.append_text(_("Shortest")); @@ -677,7 +677,7 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi freesound_sort.append_text(_("Highest rated")); freesound_sort.append_text(_("Lowest rated")); freesound_sort.set_active(0); - + passbox->pack_start (freesound_search_btn, false, false); passbox->pack_start (freesound_more_btn, false, false); freesound_more_btn.set_label(_("More")); @@ -686,11 +686,11 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi passbox->pack_start (freesound_similar_btn, false, false); freesound_similar_btn.set_label(_("Similar")); freesound_similar_btn.set_sensitive(false); - + scroll = manage(new ScrolledWindow); scroll->add(freesound_list_view); scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - + vbox = manage(new VBox); vbox->set_spacing (3); vbox->pack_start (*passbox, PACK_SHRINK); @@ -710,7 +710,7 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi freesound_list_view.get_column(3)->set_alignment(0.5); freesound_list_view.get_column(4)->set_alignment(0.5); freesound_list_view.get_column(5)->set_alignment(0.5); - + freesound_list_view.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SoundFileBrowser::freesound_list_view_selected)); freesound_list_view.set_tooltip_column(1); @@ -1067,9 +1067,9 @@ SoundFileBrowser::freesound_similar_clicked () prev_cursor = gdk_window_get_cursor (get_window()->gobj()); gdk_window_set_cursor (get_window()->gobj(), gdk_cursor_new(GDK_WATCH)); gdk_flush(); - + std::string theString = mootcher.searchSimilar(id); - + gdk_window_set_cursor (get_window()->gobj(), prev_cursor); handle_freesound_results(theString); } @@ -1353,28 +1353,28 @@ SoundFileOmega::reset_options () if (selected_audio_track_cnt > 0) { if (channel_combo.get_active_text().length()) { ImportDisposition id = get_channel_disposition(); - + switch (id) { case Editing::ImportDistinctFiles: if (selected_audio_track_cnt == paths.size()) { action_strings.push_back (importmode2string (ImportToTrack)); } break; - + case Editing::ImportDistinctChannels: /* XXX it would be nice to allow channel-per-selected track but its too hard we don't want to deal with all the different per-file + per-track channel configurations. */ break; - + default: action_strings.push_back (importmode2string (ImportToTrack)); break; } } } - + } else { /* MIDI ONLY */ @@ -1489,7 +1489,7 @@ SoundFileOmega::reset_options () /* We must copy MIDI files or those from Freesound * or any file if we are under nsm control */ bool const must_copy = _session->get_nsm_state() || have_a_midi_file || notebook.get_current_page() == 2; - + if (UIConfiguration::instance().get_only_copy_imported_files()) { if (selection_can_be_embedded_with_links && !must_copy) { @@ -1505,7 +1505,7 @@ SoundFileOmega::reset_options () if (must_copy) { copy_files_btn.set_active (true); - } + } copy_files_btn.set_sensitive (!must_copy); } @@ -1952,14 +1952,14 @@ SoundFileOmega::do_something (int action) } /* lets do it */ - + vector paths = get_paths (); ImportPosition pos = get_position (); ImportMode mode = get_mode (); ImportDisposition chns = get_channel_disposition (); PluginInfoPtr instrument = instrument_combo.selected_instrument(); framepos_t where; - + switch (pos) { case ImportAtEditPoint: where = PublicEditor::instance().get_preferred_edit_position (); @@ -1974,13 +1974,13 @@ SoundFileOmega::do_something (int action) where = _session->current_start_frame(); break; } - + SrcQuality quality = get_src_quality(); - + if (copy_files_btn.get_active()) { PublicEditor::instance().do_import (paths, chns, mode, quality, where, instrument); } else { PublicEditor::instance().do_embed (paths, chns, mode, where, instrument); } } - + diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h index 1eb6f2e122..3c4f088258 100644 --- a/gtk2_ardour/sfdb_ui.h +++ b/gtk2_ardour/sfdb_ui.h @@ -198,7 +198,7 @@ class SoundFileBrowser : public ArdourWindow void freesound_search(); void refresh_display(std::string ID, std::string file); - + protected: bool resetting_ourselves; int matches; @@ -239,7 +239,7 @@ class SoundFileBrowser : public ArdourWindow void freesound_more_clicked (); void freesound_similar_clicked (); int freesound_page; - + void chooser_file_activated (); std::string freesound_get_audio_file(Gtk::TreeIter iter); diff --git a/gtk2_ardour/shuttle_control.cc b/gtk2_ardour/shuttle_control.cc index ba520152c4..94c27c2807 100644 --- a/gtk2_ardour/shuttle_control.cc +++ b/gtk2_ardour/shuttle_control.cc @@ -322,7 +322,7 @@ ShuttleControl::on_button_release_event (GdkEventButton* ev) shuttle_grabbed = false; remove_modal_grab (); gdk_pointer_ungrab (GDK_CURRENT_TIME); - + if (Config->get_shuttle_behaviour() == Sprung) { if (shuttle_speed_on_grab == 0 ) { _session->request_stop (); @@ -397,7 +397,7 @@ ShuttleControl::on_scroll_event (GdkEventScroll* ev) default: return false; } - + if (semis) { float lower_side_of_dead_zone = semitones_as_fract (-24, true); diff --git a/gtk2_ardour/soundcloud_export_selector.h b/gtk2_ardour/soundcloud_export_selector.h index fcfbdfe91b..c05214a489 100644 --- a/gtk2_ardour/soundcloud_export_selector.h +++ b/gtk2_ardour/soundcloud_export_selector.h @@ -40,7 +40,7 @@ class SoundcloudExportSelector : public Gtk::VBox, public ARDOUR::SessionHandleP Gtk::CheckButton soundcloud_download_checkbox; bool soundcloud_cancel; Gtk::ProgressBar progress_bar; - + }; #endif // __soundcloud_export_selector_h__ diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index 2b28ff4953..63ca20d057 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -45,7 +45,7 @@ Splash* Splash::the_splash = 0; Splash::Splash () { assert (the_splash == 0); - + std::string splash_file; if (!find_file (ardour_data_search_path(), "splash.png", splash_file)) { @@ -202,7 +202,7 @@ void Splash::display () { bool was_mapped = is_mapped (); - + if (!was_mapped) { expose_done = false; expose_is_the_one = false; @@ -210,7 +210,7 @@ Splash::display () pop_front (); present (); - + if (!was_mapped) { while (!expose_done) { gtk_main_iteration (); @@ -230,7 +230,7 @@ Splash::message (const string& msg) layout->set_markup (str); Glib::RefPtr win = darea.get_window(); - + if (win) { expose_done = false; diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index c19c14f7aa..e020ee18d7 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -79,14 +79,14 @@ ArdourStartup::ArdourStartup () { set_position (WIN_POS_CENTER); set_border_width (12); - + if ((icon_pixbuf = ::get_icon ("ardour_icon_48px")) == 0) { throw failed_constructor(); } - + list > window_icons; Glib::RefPtr icon; - + if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { window_icons.push_back (icon); } @@ -102,7 +102,7 @@ ArdourStartup::ArdourStartup () if (!window_icons.empty ()) { set_default_icon_list (window_icons); } - + setup_new_user_page (); setup_first_time_config_page (); setup_monitoring_choice_page (); @@ -124,7 +124,7 @@ ArdourStartup::required () */ const int current_version = atoi (PROGRAM_VERSION); - + for (int v = current_version; v != 0; --v) { if (Glib::file_test (ARDOUR::been_here_before_path (v), Glib::FILE_TEST_EXISTS)) { if (v != current_version) { @@ -179,7 +179,7 @@ ArdourStartup::default_dir_changed () { Config->set_default_session_parent_dir (default_dir_chooser->get_filename()); // make new session folder chooser point to the new default - new_folder_chooser.set_current_folder (Config->get_default_session_parent_dir()); + new_folder_chooser.set_current_folder (Config->get_default_session_parent_dir()); config_changed (); } @@ -424,7 +424,7 @@ ArdourStartup::on_apply () PBD::ScopedFileDescriptor fout (g_open (been_here_before_path ().c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666)); } - + _response = RESPONSE_OK; gtk_main_quit (); } diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc index 0736a426c1..91c8b025ac 100644 --- a/gtk2_ardour/stereo_panner.cc +++ b/gtk2_ardour/stereo_panner.cc @@ -306,7 +306,7 @@ StereoPanner::on_button_press_event (GdkEventButton* ev) if (_panner_shell->bypassed()) { return true; } - + drag_start_x = ev->x; last_drag_x = ev->x; @@ -447,7 +447,7 @@ StereoPanner::on_button_release_event (GdkEventButton* ev) if (PannerInterface::on_button_release_event (ev)) { return true; } - + if (ev->button != 1) { return false; } @@ -537,7 +537,7 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) if (dragging_left) { delta = -delta; } - + if (dragging_left || dragging_right) { if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { @@ -547,7 +547,7 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) */ _panner->freeze (); - + double pv = position_control->get_value(); if (dragging_left) { @@ -573,27 +573,27 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) } else { /* maintain position as invariant as we change the width */ - + /* create a detent close to the center */ - + if (!detented && fabs (current_width) < 0.02) { detented = true; /* snap to zero */ width_control->set_value (0); } - + if (detented) { - + accumulated_delta += delta; - + /* have we pulled far enough to escape ? */ - + if (fabs (accumulated_delta) >= 0.025) { width_control->set_value (current_width + accumulated_delta); detented = false; accumulated_delta = false; } - + } else { /* width needs to change by 2 * delta because both L & R move */ width_control->set_value (current_width + (delta * 2.0)); diff --git a/gtk2_ardour/stereo_panner.h b/gtk2_ardour/stereo_panner.h index 1c278f344d..ba98232146 100644 --- a/gtk2_ardour/stereo_panner.h +++ b/gtk2_ardour/stereo_panner.h @@ -61,7 +61,7 @@ class StereoPanner : public PannerInterface private: PannerEditor* editor (); boost::shared_ptr _panner_shell; - + boost::shared_ptr position_control; boost::shared_ptr width_control; PBD::ScopedConnectionList panvalue_connections; diff --git a/gtk2_ardour/stereo_panner_editor.cc b/gtk2_ardour/stereo_panner_editor.cc index 0cc856f500..e7a4a452fe 100644 --- a/gtk2_ardour/stereo_panner_editor.cc +++ b/gtk2_ardour/stereo_panner_editor.cc @@ -40,12 +40,12 @@ StereoPannerEditor::StereoPannerEditor (StereoPanner* p) t->set_spacings (6); int n = 0; - + t->attach (*manage (left_aligned_label (_("Position"))), 0, 1, n, n + 1); t->attach (_position, 1, 2, n, n + 1); t->attach (*manage (left_aligned_label (_("%"))), 2, 3, n, n + 1); ++n; - + t->attach (*manage (left_aligned_label (_("Width"))), 0, 1, n, n + 1); t->attach (_width, 1, 2, n, n + 1); t->attach (*manage (left_aligned_label (_("%"))), 2, 3, n, n + 1); @@ -66,7 +66,7 @@ StereoPannerEditor::StereoPannerEditor (StereoPanner* p) _panner->get_width_controllable()->Changed.connect ( _connections, invalidator (*this), boost::bind (&StereoPannerEditor::update_editor, this), gui_context () ); - + _panner->DropReferences.connect (_connections, invalidator (*this), boost::bind (&StereoPannerEditor::panner_going_away, this), gui_context ()); _position.signal_value_changed().connect (sigc::mem_fun (*this, &StereoPannerEditor::position_changed)); _width.signal_value_changed().connect (sigc::mem_fun (*this, &StereoPannerEditor::width_changed)); @@ -87,7 +87,7 @@ StereoPannerEditor::update_editor () if (!_panner) { return; } - + _ignore_changes = true; _position.set_value (100 * _panner->get_position_controllable()->get_value ()); _width.set_value (100 * _panner->get_width_controllable()->get_value ()); @@ -135,4 +135,4 @@ StereoPannerEditor::set_width_range () pair const wr = _panner->panner()->width_range (); _width.set_range (wr.first * 100, wr.second * 100); } - + diff --git a/gtk2_ardour/stereo_panner_editor.h b/gtk2_ardour/stereo_panner_editor.h index 8c561e5545..1a01564a4c 100644 --- a/gtk2_ardour/stereo_panner_editor.h +++ b/gtk2_ardour/stereo_panner_editor.h @@ -35,7 +35,7 @@ private: void width_changed (); void set_position_range (); void set_width_range (); - + StereoPanner* _panner; Gtk::SpinButton _position; Gtk::SpinButton _width; diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index 5f50b7e8cb..c737f7842c 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -66,7 +66,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Container* canvas_g , last_rec_data_frame(0) { CANVAS_DEBUG_NAME (_canvas_group, string_compose ("SV canvas group %1", _trackview.name())); - + /* set_position() will position the group */ canvas_rect = new ArdourCanvas::Rectangle (_canvas_group); @@ -583,7 +583,7 @@ StreamView::get_selectables (framepos_t start, framepos_t end, double top, doubl layer_t const l = (*i)->region()->layer (); layer_ok = (min_layer <= l && l <= max_layer); } - + if (within) { if ((*i)->region()->coverage (start, end) == Evoral::OverlapExternal && layer_ok) { results.push_back (*i); @@ -593,7 +593,7 @@ StreamView::get_selectables (framepos_t start, framepos_t end, double top, doubl results.push_back (*i); } } - + } } @@ -619,7 +619,7 @@ StreamView::child_height () const case Expanded: return height / (_layers * 2 + 1); } - + abort(); /* NOTREACHED */ return height; } @@ -670,7 +670,7 @@ StreamView::set_layer_display (LayerDisplay d) if (_layer_display == Overlaid) { layer_regions (); } - + update_contents_height (); update_coverage_frames (); } diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 0c3faf3b21..8a56040afb 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -118,7 +118,7 @@ public: void check_record_layers (boost::shared_ptr, ARDOUR::framepos_t); virtual void playlist_layered (boost::weak_ptr); - + sigc::signal RegionViewAdded; sigc::signal RegionViewRemoved; /** Emitted when the height of regions has changed */ diff --git a/gtk2_ardour/sys_ex.cc b/gtk2_ardour/sys_ex.cc index 3607aa5e2a..b6251938a7 100644 --- a/gtk2_ardour/sys_ex.cc +++ b/gtk2_ardour/sys_ex.cc @@ -39,7 +39,7 @@ SysEx::SysEx ( UIConfiguration::instance().color_mod ("midi sysex fill", "midi sysex fill"), ArdourCanvas::Duple (x, y) ); - + _flag->set_text (text); } diff --git a/gtk2_ardour/sys_ex.h b/gtk2_ardour/sys_ex.h index cc3559ba1f..709841cabb 100644 --- a/gtk2_ardour/sys_ex.h +++ b/gtk2_ardour/sys_ex.h @@ -44,7 +44,7 @@ public: ArdourCanvas::Item& item() const { return *_flag; } -private: +private: bool event_handler (GdkEvent* ev); ArdourCanvas::Flag* _flag; diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc index 37771eff76..0b570abdaa 100644 --- a/gtk2_ardour/tempo_dialog.cc +++ b/gtk2_ardour/tempo_dialog.cc @@ -105,7 +105,7 @@ TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, if (x == note_types.end()) { pulse_selector.set_active_text (strings[3]); // "quarter" } - + Table* table; if (UIConfiguration::instance().get_allow_non_quarter_pulse()) { @@ -249,7 +249,7 @@ double TempoDialog::get_note_type () { NoteTypes::iterator x = note_types.find (pulse_selector.get_active_text()); - + if (x == note_types.end()) { error << string_compose(_("incomprehensible pulse note type (%1)"), pulse_selector.get_active_text()) << endmsg; return 0; @@ -367,7 +367,7 @@ MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, b break; } } - + if (x == note_types.end()) { note_type.set_active_text (strings[3]); // "quarter" } @@ -498,7 +498,7 @@ double MeterDialog::get_note_type () { NoteTypes::iterator x = note_types.find (note_type.get_active_text()); - + if (x == note_types.end()) { error << string_compose(_("incomprehensible meter note type (%1)"), note_type.get_active_text()) << endmsg; return 0; diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc index 2abfb79105..3d1a1f8952 100644 --- a/gtk2_ardour/theme_manager.cc +++ b/gtk2_ardour/theme_manager.cc @@ -78,16 +78,16 @@ ThemeManager::ThemeManager() , palette_window (0) { /* Now the alias list */ - + alias_list = TreeStore::create (alias_columns); alias_display.set_model (alias_list); alias_display.append_column (_("Object"), alias_columns.name); - + Gtkmm2ext::CellRendererColorSelector* color_renderer = manage (new Gtkmm2ext::CellRendererColorSelector); TreeViewColumn* color_column = manage (new TreeViewColumn (_("Color"), *color_renderer)); color_column->add_attribute (color_renderer->property_color(), alias_columns.color); alias_display.append_column (*color_column); - + alias_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0)); alias_display.get_column (0)->set_expand (true); alias_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1)); @@ -101,7 +101,7 @@ ThemeManager::ThemeManager() alias_scroller.add (alias_display); /* various buttons */ - + RadioButton::Group group = dark_button.get_group(); light_button.set_group(group); theme_selection_hbox.set_homogeneous(false); @@ -137,7 +137,7 @@ ThemeManager::ThemeManager() pack_start (*hbox, PACK_SHRINK); } - + hbox = Gtk::manage (new Gtk::HBox()); hbox->set_spacing (6); hbox->pack_start (waveform_gradient_depth, true, true); @@ -156,21 +156,21 @@ ThemeManager::ThemeManager() palette_scroller.add (palette_viewport); modifier_scroller.add (modifier_vbox); - + notebook.append_page (alias_scroller, _("Items")); notebook.append_page (palette_scroller, _("Palette")); notebook.append_page (modifier_scroller, _("Transparency")); - + pack_start (notebook); show_all (); waveform_gradient_depth.set_update_policy (Gtk::UPDATE_DELAYED); timeline_item_gradient_depth.set_update_policy (Gtk::UPDATE_DELAYED); - + color_dialog.get_colorsel()->set_has_opacity_control (true); color_dialog.get_colorsel()->set_has_palette (true); - + set_ui_to_state(); color_dialog.get_ok_button()->signal_clicked().connect (sigc::bind (sigc::mem_fun (color_dialog, &Gtk::Dialog::response), RESPONSE_ACCEPT)); @@ -200,7 +200,7 @@ ThemeManager::ThemeManager() /* no need to call setup_palette() here, it will be done when its size is allocated */ setup_aliases (); setup_modifiers (); - + UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed)); } @@ -216,7 +216,7 @@ ThemeManager::setup_modifiers () Gtk::HBox* mod_hbox; Gtk::Label* mod_label; Gtk::HScale* mod_scale; - + Gtkmm2ext::container_clear (modifier_vbox); for (UIConfiguration::Modifiers::const_iterator m = modifiers.begin(); m != modifiers.end(); ++m) { @@ -231,7 +231,7 @@ ThemeManager::setup_modifiers () mod_label = manage (new Label (m->first)); mod_label->set_alignment (1.0, 0.5); mod_label->set_size_request (150, -1); /* 150 pixels should be enough for anyone */ - + mod_hbox->pack_start (*mod_label, false, true, 12); mod_hbox->pack_start (*mod_scale, true, true); @@ -246,7 +246,7 @@ void ThemeManager::modifier_edited (Gtk::Range* range, string name) { using namespace ArdourCanvas; - + double alpha = range->get_value(); SVAModifier svam (SVAModifier::Assign, -1.0, -1.0, alpha); UIConfiguration::instance().set_modifier (name, svam); @@ -256,8 +256,8 @@ void ThemeManager::colors_changed () { setup_palette (); - setup_aliases (); - setup_modifiers (); + setup_aliases (); + setup_modifiers (); } int @@ -338,7 +338,7 @@ ThemeManager::on_dark_theme_button_toggled() if (!dark_button.get_active()) return; UIConfiguration* uic (&UIConfiguration::instance()); - + uic->set_color_file("dark"); } @@ -348,7 +348,7 @@ ThemeManager::on_light_theme_button_toggled() if (!light_button.get_active()) return; UIConfiguration* uic (&UIConfiguration::instance()); - + uic->set_color_file("light"); } @@ -409,7 +409,7 @@ ThemeManager::initialize_palette_canvas (ArdourCanvas::Canvas& canvas) canvas.set_background_color (rgba_to_color (0.0, 0.0, 1.0, 0.0)); /* bi-directional scroll group */ - + ScrollGroup* scroll_group = new ScrollGroup (canvas.root(), ScrollGroup::ScrollSensitivity (ScrollGroup::ScrollsVertically|ScrollGroup::ScrollsHorizontally)); canvas.add_scroller (*scroll_group); @@ -459,7 +459,7 @@ ThemeManager::build_palette_canvas (ArdourCanvas::Canvas& canvas, ArdourCanvas:: } SortByHue sorter; sort (nc.begin(), nc.end(), sorter); - + const uint32_t color_limit = nc.size(); const double box_size = 20.0; const double width = canvas.width(); @@ -468,9 +468,9 @@ ThemeManager::build_palette_canvas (ArdourCanvas::Canvas& canvas, ArdourCanvas:: uint32_t color_num = 0; /* clear existing rects and delete them */ - + group.clear (true); - + for (uint32_t y = 0; y < height - box_size && color_num < color_limit; y += box_size) { for (uint32_t x = 0; x < width - box_size && color_num < color_limit; x += box_size) { ArdourCanvas::Rectangle* r = new ArdourCanvas::Rectangle (&group, ArdourCanvas::Rect (x, y, x + box_size, y + box_size)); @@ -501,7 +501,7 @@ ThemeManager::palette_size_request (Gtk::Requisition* req) req->height = (int) floor (c * box_size); /* add overflow row if necessary */ - + if (fmod (ncolors, c) != 0.0) { req->height += box_size; } @@ -554,7 +554,7 @@ ThemeManager::palette_color_response (int result, std::string name) using namespace ArdourCanvas; color_dialog_connection.disconnect (); - + UIConfiguration* uic (&UIConfiguration::instance()); Gdk::Color gdkcolor; double r,g, b, a; @@ -567,10 +567,10 @@ ThemeManager::palette_color_response (int result, std::string name) r = gdkcolor.get_red_p(); g = gdkcolor.get_green_p(); b = gdkcolor.get_blue_p(); - + uic->set_color (name, rgba_to_color (r, g, b, a)); break; - + default: break; } @@ -630,14 +630,14 @@ ThemeManager::choose_color_from_palette (string const & name) palette_window = new ArdourDialog (_("Color Palette")); palette_window->add_button (Stock::CANCEL, RESPONSE_REJECT); /* using CANCEL causes confusion if dialog is closed via CloseAllDialogs */ palette_window->add_button (Stock::OK, RESPONSE_OK); - + ArdourCanvas::GtkCanvas* canvas = new ArdourCanvas::GtkCanvas (); ArdourCanvas::Container* group = initialize_palette_canvas (*canvas); - + canvas->signal_size_request().connect (sigc::mem_fun (*this, &ThemeManager::palette_size_request)); canvas->signal_size_allocate().connect (sigc::bind (sigc::mem_fun (*this, &ThemeManager::palette_canvas_allocated), group, canvas, sigc::bind (sigc::mem_fun (*this, &ThemeManager::alias_palette_event), name))); - + palette_window->get_vbox()->pack_start (*canvas); palette_window->show_all (); @@ -651,7 +651,7 @@ void ThemeManager::setup_aliases () { using namespace ArdourCanvas; - + UIConfiguration* uic (&UIConfiguration::instance()); UIConfiguration::ColorAliases& aliases (uic->color_aliases); @@ -683,7 +683,7 @@ ThemeManager::setup_aliases () row = *(alias_list->append()); row[alias_columns.name] = parent; row[alias_columns.alias] = ""; - + /* now add the child as a child of this one */ row = *(alias_list->insert (row->children().end())); diff --git a/gtk2_ardour/theme_manager.h b/gtk2_ardour/theme_manager.h index d4a8653bcf..6ed58207fa 100644 --- a/gtk2_ardour/theme_manager.h +++ b/gtk2_ardour/theme_manager.h @@ -64,20 +64,20 @@ class ThemeManager : public Gtk::VBox private: Gtk::Notebook notebook; - + struct BasicColorDisplayModelColumns : public Gtk::TreeModel::ColumnRecord { BasicColorDisplayModelColumns() { add (name); add (gdkcolor); } - + Gtk::TreeModelColumn name; Gtk::TreeModelColumn gdkcolor; }; - + Gtk::ColorSelectionDialog color_dialog; sigc::connection color_dialog_connection; - + Gtk::HBox theme_selection_hbox; Gtk::RadioButton dark_button; Gtk::RadioButton light_button; @@ -104,7 +104,7 @@ class ThemeManager : public Gtk::VBox Gtk::ScrolledWindow palette_scroller; ArdourCanvas::GtkCanvasViewport palette_viewport; ArdourCanvas::Container* palette_group; - + /* these methods create and manage a canvas for use in either the palette tab or in a separate dialog. Different behaviour is accomplished by changing the event handler passed into the @@ -130,7 +130,7 @@ class ThemeManager : public Gtk::VBox on it inside the palette tab. */ void edit_palette_color (std::string); - + struct ColorAliasModelColumns : public Gtk::TreeModel::ColumnRecord { ColorAliasModelColumns() { add (name); @@ -138,7 +138,7 @@ class ThemeManager : public Gtk::VBox add (color); add (key); } - + Gtk::TreeModelColumn name; Gtk::TreeModelColumn alias; Gtk::TreeModelColumn color; @@ -154,9 +154,9 @@ class ThemeManager : public Gtk::VBox ArdourDialog* palette_window; sigc::connection palette_response_connection; - + void choose_color_from_palette (std::string const &target_name); - + bool alias_palette_event (GdkEvent*, std::string, std::string); void alias_palette_response (int, std::string, std::string); @@ -165,10 +165,10 @@ class ThemeManager : public Gtk::VBox Gtk::ScrolledWindow modifier_scroller; Gtk::VBox modifier_vbox; - + void setup_modifiers (); void modifier_edited (Gtk::Range*, std::string); - + void colors_changed (); void set_ui_to_state (); }; diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 09799c7d14..436e161583 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -138,7 +138,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie CANVAS_DEBUG_NAME (selection_group, "selection for TAV"); selection_group->set_data (X_("timeselection"), (void *) 1); selection_group->hide(); - + _ghost_group = new ArdourCanvas::Container (_canvas_display); CANVAS_DEBUG_NAME (_ghost_group, "ghost for TAV"); _ghost_group->lower_to_bottom(); @@ -319,7 +319,7 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent) _canvas_display->raise_to_top (); _canvas_display->show (); - + _hidden = false; _effective_height = current_height (); @@ -407,7 +407,7 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event) } _ebox_release_can_act = true; - + if (maybe_set_cursor (event->y) > 0) { _resize_drag_start = event->y_root; } @@ -668,7 +668,7 @@ TimeAxisView::begin_name_edit () if (can_edit_name()) { name_entry = manage (new Gtkmm2ext::FocusEntry); - + name_entry->set_width_chars(8); // min width, entry expands name_entry->set_name ("EditorTrackNameDisplay"); @@ -681,7 +681,7 @@ TimeAxisView::begin_name_edit () if (name_label.is_ancestor (name_hbox)) { name_hbox.remove (name_label); } - + name_hbox.pack_end (*name_entry, true, true); name_entry->show (); @@ -705,9 +705,9 @@ TimeAxisView::end_name_edit (int response) */ return; } - + PBD::Unwinder uw (ending_name_edit, true); - + bool edit_next = false; bool edit_prev = false; @@ -743,24 +743,24 @@ TimeAxisView::end_name_edit (int response) TrackViewList const & allviews = _editor.get_track_views (); TrackViewList::const_iterator i = find (allviews.begin(), allviews.end(), this); - + if (i != allviews.end()) { - + do { if (++i == allviews.end()) { return; } - + RouteTimeAxisView* rtav = dynamic_cast(*i); - + if (rtav && rtav->route()->record_enabled()) { continue; } - + if (!(*i)->hidden()) { break; } - + } while (true); } @@ -773,28 +773,28 @@ TimeAxisView::end_name_edit (int response) TrackViewList const & allviews = _editor.get_track_views (); TrackViewList::const_iterator i = find (allviews.begin(), allviews.end(), this); - + if (i != allviews.begin()) { do { if (i == allviews.begin()) { return; } - + --i; - + RouteTimeAxisView* rtav = dynamic_cast(*i); - + if (rtav && rtav->route()->record_enabled()) { continue; } - + if (!(*i)->hidden()) { break; } - + } while (true); } - + if ((i != allviews.end()) && (*i != this) && !(*i)->hidden()) { _editor.ensure_time_axis_view_is_visible (**i, false); (*i)->begin_name_edit (); @@ -1226,19 +1226,19 @@ TimeAxisView::color_handler () (*i)->start_trim->set_fill_color (UIConfiguration::instance().color ("selection")); (*i)->start_trim->set_outline_color (UIConfiguration::instance().color ("selection")); - + (*i)->end_trim->set_fill_color (UIConfiguration::instance().color ("selection")); (*i)->end_trim->set_outline_color (UIConfiguration::instance().color ("selection")); } - + for (list::iterator i = free_selection_rects.begin(); i != free_selection_rects.end(); ++i) { - + (*i)->rect->set_fill_color (UIConfiguration::instance().color_mod ("selection rect", "selection rect")); (*i)->rect->set_outline_color (UIConfiguration::instance().color ("selection")); - + (*i)->start_trim->set_fill_color (UIConfiguration::instance().color ("selection")); (*i)->start_trim->set_outline_color (UIConfiguration::instance().color ("selection")); - + (*i)->end_trim->set_fill_color (UIConfiguration::instance().color ("selection")); (*i)->end_trim->set_outline_color (UIConfiguration::instance().color ("selection")); } @@ -1314,7 +1314,7 @@ TimeAxisView::covered_by_y_range (double y0, double y1) const /* if either the top or bottom of the axisview is in the vertical * range, we cover it. */ - + if ((y0 < _y_position && y1 < _y_position) || (y0 >= _y_position + height && y1 >= _y_position + height)) { return false; @@ -1392,7 +1392,7 @@ TimeAxisView::reset_visual_state () /* this method is not required to trigger a global redraw */ string str = gui_property ("height"); - + if (!str.empty()) { set_height (atoi (str)); } else { diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index c985088c1e..5a85005e3a 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -146,9 +146,9 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other) /* share the other's parent, but still create a new group */ ArdourCanvas::Item* parent = other.group->parent(); - + _selected = other._selected; - + init (parent, other.samples_per_pixel, other.fill_color, other.frame_position, other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name); } @@ -189,7 +189,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co ArdourCanvas::Rect (0.0, 0.0, trackview.editor().sample_to_pixel(duration), trackview.current_height())); - + frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT)); CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name())); @@ -200,7 +200,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co frame->set_outline_color (UIConfiguration::instance().color ("time axis frame")); } } - + if (UIConfiguration::instance().get_show_name_highlight() && (visibility & ShowNameHighlight)) { /* rectangle size will be set in ::manage_name_highlight() */ @@ -488,7 +488,7 @@ TimeAxisViewItem::set_selected(bool yn) if (_selected == yn) { return; } - + Selectable::set_selected (yn); set_frame_color (); set_name_text_color (); @@ -557,7 +557,7 @@ TimeAxisViewItem::set_height (double height) } if (frame) { - + frame->set_y0 (0.0); frame->set_y1 (height); @@ -603,7 +603,7 @@ TimeAxisViewItem::manage_name_highlight () name_highlight->show(); // name_highlight->set_x_position (1.0); name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width - 2.0, _height)); - + } else { name_highlight->hide(); } @@ -658,10 +658,10 @@ TimeAxisViewItem::set_name_text_color () if (!name_text) { return; } - + uint32_t f; - + if (UIConfiguration::instance().get_show_name_highlight()) { /* name text will always be on top of name highlight, which will always use our fill color. @@ -718,7 +718,7 @@ TimeAxisViewItem::set_frame_gradient () frame->set_gradient (ArdourCanvas::Fill::StopList (), 0); return; } - + ArdourCanvas::Fill::StopList stops; double r, g, b, a; double h, s, v; @@ -726,18 +726,18 @@ TimeAxisViewItem::set_frame_gradient () /* need to get alpha value */ ArdourCanvas::color_to_rgba (f, r, g, b, a); - + stops.push_back (std::make_pair (0.0, f)); - + /* now a darker version */ - + ArdourCanvas::color_to_hsv (f, h, s, v); v = min (1.0, v * (1.0 - UIConfiguration::instance().get_timeline_item_gradient_depth())); - + ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a); stops.push_back (std::make_pair (1.0, darker)); - + frame->set_gradient (stops, true); } @@ -895,7 +895,7 @@ TimeAxisViewItem::manage_name_text () name_text->hide (); return; } - + if (name_text->text().empty()) { name_text->hide (); } diff --git a/gtk2_ardour/time_fx_dialog.cc b/gtk2_ardour/time_fx_dialog.cc index 5d8bf57a3b..7efabc93ed 100644 --- a/gtk2_ardour/time_fx_dialog.cc +++ b/gtk2_ardour/time_fx_dialog.cc @@ -157,7 +157,7 @@ TimeFXDialog::TimeFXDialog (Editor& e, bool pitch) } set_default_response (Gtk::RESPONSE_ACCEPT); - + VBox* progress_box = manage (new VBox); progress_box->set_spacing (6); diff --git a/gtk2_ardour/time_fx_dialog.h b/gtk2_ardour/time_fx_dialog.h index 424bfe9813..a7e4a7ab10 100644 --- a/gtk2_ardour/time_fx_dialog.h +++ b/gtk2_ardour/time_fx_dialog.h @@ -68,7 +68,7 @@ public: gint delete_in_progress (GdkEventAny*); private: - + void update_progress_gui (float); }; diff --git a/gtk2_ardour/time_info_box.cc b/gtk2_ardour/time_info_box.cc index 55e7472f4f..a26ec50932 100644 --- a/gtk2_ardour/time_info_box.cc +++ b/gtk2_ardour/time_info_box.cc @@ -235,7 +235,7 @@ TimeInfoBox::sync_punch_mode (AudioClock* src) syncing_punch = false; } } - + void TimeInfoBox::set_session (Session* s) @@ -251,11 +251,11 @@ TimeInfoBox::set_session (Session* s) if (s) { Location* punch = s->locations()->auto_punch_location (); - + if (punch) { watch_punch (punch); } - + punch_changed (punch); _session->auto_punch_location_changed.connect (_session_connections, MISSING_INVALIDATOR, @@ -329,7 +329,7 @@ TimeInfoBox::selection_changed () Glib::RefPtr act = ActionManager::get_action ("MouseMode", "set-mouse-mode-object-range"); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); - if (tact && tact->get_active() && !selection.regions.empty()) { + if (tact && tact->get_active() && !selection.regions.empty()) { /* show selected regions */ s = selection.regions.start(); e = selection.regions.end_frame(); @@ -357,7 +357,7 @@ TimeInfoBox::selection_changed () default: selection_start->set_off (true); selection_end->set_off (true); - selection_length->set_off (true); + selection_length->set_off (true); break; } } @@ -395,5 +395,5 @@ TimeInfoBox::punch_changed (Location* loc) punch_start->set (loc->start()); punch_end->set (loc->end()); -} +} diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 232eb8f1a4..d4ec4ca9f8 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -120,7 +120,7 @@ void UIConfiguration::parameter_changed (string param) { _dirty = true; - + if (param == "ui-rc-file") { load_rc_file (true); } else if (param == "color-file") { @@ -136,9 +136,9 @@ UIConfiguration::reset_gtk_theme () stringstream ss; ss << "gtk_color_scheme = \"" << hex; - + for (ColorAliases::iterator g = color_aliases.begin(); g != color_aliases.end(); ++g) { - + if (g->first.find ("gtk_") == 0) { const string gtk_name = g->first.substr (4); ss << gtk_name << ":#" << std::setw (6) << setfill ('0') << (color (g->second) >> 8) << ';'; @@ -223,7 +223,7 @@ UIConfiguration::load_defaults () { std::string rcfile; int ret = -1; - + if (find_file (ardour_config_search_path(), default_ui_config_file_name, rcfile) ) { XMLTree tree; @@ -274,7 +274,7 @@ UIConfiguration::load_color_theme (bool allow_own) if (!found) { basename = color_file.get(); basename += ".colors"; - + if (find_file (ardour_config_search_path(), basename, cfile)) { found = true; } @@ -283,7 +283,7 @@ UIConfiguration::load_color_theme (bool allow_own) if (found) { XMLTree tree; - + info << string_compose (_("Loading color file %1"), cfile) << endmsg; if (!tree.read (cfile.c_str())) { @@ -322,7 +322,7 @@ UIConfiguration::store_color_theme () parent->add_child_nocopy (*node); } root->add_child_nocopy (*parent); - + parent = new XMLNode (X_("ColorAliases")); for (ColorAliases::const_iterator i = color_aliases.begin(); i != color_aliases.end(); ++i) { XMLNode* node = new XMLNode (X_("ColorAlias")); @@ -343,7 +343,7 @@ UIConfiguration::store_color_theme () XMLTree tree; std::string colorfile = Glib::build_filename (user_config_directory(), (string ("my-") + color_file.get() + ".colors")); - + tree.set_root (root); if (!tree.write (colorfile.c_str())){ @@ -410,7 +410,7 @@ UIConfiguration::save_state() if (_dirty) { std::string rcfile = Glib::build_filename (user_config_directory(), ui_config_file_name); - + XMLTree tree; tree.set_root (&get_state()); @@ -434,7 +434,7 @@ UIConfiguration::save_state() colors_modified = false; modifiers_modified = false; } - + return 0; } @@ -530,7 +530,7 @@ UIConfiguration::load_color_aliases (XMLNode const & node) XMLNodeConstIterator niter; XMLProperty const *name; XMLProperty const *alias; - + color_aliases.clear (); for (niter = nlist.begin(); niter != nlist.end(); ++niter) { @@ -553,7 +553,7 @@ UIConfiguration::load_colors (XMLNode const & node) XMLNodeConstIterator niter; XMLProperty const *name; XMLProperty const *color; - + colors.clear (); for (niter = nlist.begin(); niter != nlist.end(); ++niter) { @@ -579,9 +579,9 @@ UIConfiguration::load_modifiers (XMLNode const & node) XMLNodeConstIterator niter; XMLProperty const *name; XMLProperty const *mod; - + modifiers.clear (); - + for (niter = nlist.begin(); niter != nlist.end(); ++niter) { if ((*niter)->name() != X_("Modifier")) { continue; @@ -639,7 +639,7 @@ UIConfiguration::color (const std::string& name, bool* failed) const if (failed) { *failed = false; } - + if (e != color_aliases.end ()) { Colors::const_iterator rc = colors.find (e->second); if (rc != colors.end()) { @@ -652,7 +652,7 @@ UIConfiguration::color (const std::string& name, bool* failed) const return rc->second; } } - + if (!failed) { /* only show this message if the caller wasn't interested in the fail status. @@ -663,7 +663,7 @@ UIConfiguration::color (const std::string& name, bool* failed) const if (failed) { *failed = true; } - + return rgba_to_color ((g_random_int()%256)/255.0, (g_random_int()%256)/255.0, (g_random_int()%256)/255.0, diff --git a/gtk2_ardour/ui_config.h b/gtk2_ardour/ui_config.h index 15a58ffc44..06338aae39 100644 --- a/gtk2_ardour/ui_config.h +++ b/gtk2_ardour/ui_config.h @@ -69,7 +69,7 @@ private: void set_alias (std::string const & name, std::string const & alias); void set_color (const std::string& name, ArdourCanvas::Color); void set_modifier (std::string const &, ArdourCanvas::SVAModifier svam); - + std::string color_as_alias (ArdourCanvas::Color c); ArdourCanvas::Color quantized (ArdourCanvas::Color) const; @@ -85,7 +85,7 @@ private: void set_pango_fontsize (); float get_ui_scale (); - + sigc::signal DPIReset; sigc::signal ParameterChanged; @@ -102,7 +102,7 @@ private: /** called after the GUI toolkit has been initialized. */ UIConfiguration* post_gui_init (); - + #undef UI_CONFIG_VARIABLE #define UI_CONFIG_VARIABLE(Type,var,name,value) \ Type get_##var () const { return var.get(); } \ @@ -132,7 +132,7 @@ private: bool aliases_modified; bool colors_modified; bool modifiers_modified; - + int store_color_theme (); void load_color_aliases (XMLNode const &); void load_colors (XMLNode const &); diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index e0607675df..68f4c83426 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -507,7 +507,7 @@ ARDOUR_UI_UTILS::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEv ev->keyval, fakekey)); DEBUG_TRACE (DEBUG::Accelerators, string_compose ("\tmodified modifier was %1\n", show_gdk_event_state (modifier))); - + if (allow_activating && gtk_accel_groups_activate(G_OBJECT(win), fakekey, modifier)) { DEBUG_TRACE (DEBUG::Accelerators, "\taccel group activated by fakekey\n"); return true; @@ -590,7 +590,7 @@ ARDOUR_UI_UTILS::get_icon_sets () Searchpath spath(ARDOUR::ardour_data_search_path()); spath.add_subdirectory_to_paths ("icons"); vector r; - + r.push_back (_("default")); for (vector::iterator s = spath.begin(); s != spath.end(); ++s) { @@ -626,22 +626,22 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_imag /* add "icons/icon_set" but .. not allowed to add both of these at once */ spath.add_subdirectory_to_paths ("icons"); spath.add_subdirectory_to_paths (icon_set); - + find_file (spath, name, data_file_path); } else { spath.add_subdirectory_to_paths ("icons"); find_file (spath, name, data_file_path); } - + if (is_image && data_file_path.empty()) { - + if (!icon_set.empty() && icon_set != _("default")) { warning << string_compose (_("icon \"%1\" not found for icon set \"%2\", fallback to default"), cname, icon_set) << endmsg; } - + Searchpath def (ARDOUR::ardour_data_search_path()); def.add_subdirectory_to_paths ("icons"); - + if (!find_file (def, name, data_file_path)) { fatal << string_compose (_("cannot find icon image for %1 using %2"), name, spath.to_string()) << endmsg; abort(); /*NOTREACHED*/ diff --git a/gtk2_ardour/verbose_cursor.h b/gtk2_ardour/verbose_cursor.h index 7d12a2a13e..6160bb3296 100644 --- a/gtk2_ardour/verbose_cursor.h +++ b/gtk2_ardour/verbose_cursor.h @@ -41,7 +41,7 @@ public: void show (); void hide (); - + private: Editor* _editor; ArdourCanvas::TrackingText* _canvas_item; diff --git a/gtk2_ardour/visibility_group.cc b/gtk2_ardour/visibility_group.cc index 82621283b6..46a941d0fc 100644 --- a/gtk2_ardour/visibility_group.cc +++ b/gtk2_ardour/visibility_group.cc @@ -54,7 +54,7 @@ VisibilityGroup::add (Gtk::Widget* widget, string const & id, string const & nam m.name = name; m.visible = visible; m.override = override; - + _members.push_back (m); } @@ -161,7 +161,7 @@ VisibilityGroup::set_state (string v) } v = v.substr (comma + 1); - + } while (1); update (); @@ -195,11 +195,11 @@ VisibilityGroup::update_list_view () if (!_model) { return; } - + _ignore_list_view_change = true; _model->clear (); - + for (vector::iterator i = _members.begin(); i != _members.end(); ++i) { Gtk::TreeModel::iterator j = _model->append (); Gtk::TreeModel::Row row = *j; @@ -235,7 +235,7 @@ VisibilityGroup::list_view_visible_changed (string const & path) if (_ignore_list_view_change) { return; } - + Gtk::TreeModel::iterator i = _model->get_iter (path); if (!i) { return; diff --git a/gtk2_ardour/visibility_group.h b/gtk2_ardour/visibility_group.h index 20be7dcf72..8ac2c1db5f 100644 --- a/gtk2_ardour/visibility_group.h +++ b/gtk2_ardour/visibility_group.h @@ -36,7 +36,7 @@ class VisibilityGroup { public: VisibilityGroup (std::string const &); - + void add ( Gtk::Widget *, std::string const &, @@ -44,7 +44,7 @@ public: bool visible = false, boost::function ()> = 0 ); - + Gtk::Menu* menu (); Gtk::Widget* list_view (); bool button_press_event (GdkEventButton *); @@ -55,7 +55,7 @@ public: std::string get_state_value () const; PBD::Signal0 VisibilityChanged; - + private: struct Member { diff --git a/gtk2_ardour/volume_controller.cc b/gtk2_ardour/volume_controller.cc index 85f615aea8..346ed6e33b 100644 --- a/gtk2_ardour/volume_controller.cc +++ b/gtk2_ardour/volume_controller.cc @@ -63,7 +63,7 @@ void VolumeController::dB_printer (char buf[32], const boost::shared_ptr& c) { if (c) { - + if (_linear) { double val = accurate_coefficient_to_dB (c->get_value()); @@ -83,7 +83,7 @@ VolumeController::dB_printer (char buf[32], const boost::shared_ptrget_value()); if (step_inc < 1.0) { diff --git a/gtk2_ardour/vst_plugin_ui.cc b/gtk2_ardour/vst_plugin_ui.cc index a5e3afe300..a964e96b4e 100644 --- a/gtk2_ardour/vst_plugin_ui.cc +++ b/gtk2_ardour/vst_plugin_ui.cc @@ -94,7 +94,7 @@ VSTPluginUI::package (Gtk::Window& win) _vst->state()->width + _vst->state()->hoffset, _vst->state()->height + _vst->state()->voffset); #endif - + return 0; } diff --git a/gtk2_ardour/vst_plugin_ui.h b/gtk2_ardour/vst_plugin_ui.h index 8996fe0a21..5c8df726c7 100644 --- a/gtk2_ardour/vst_plugin_ui.h +++ b/gtk2_ardour/vst_plugin_ui.h @@ -41,11 +41,11 @@ public: virtual int package (Gtk::Window &); bool non_gtk_gui () const { return true; } - + protected: virtual int get_XID () = 0; - + boost::shared_ptr _vst; Gtk::Socket _socket; diff --git a/gtk2_ardour/window_manager.cc b/gtk2_ardour/window_manager.cc index f15e0b3621..b476787926 100644 --- a/gtk2_ardour/window_manager.cc +++ b/gtk2_ardour/window_manager.cc @@ -163,7 +163,7 @@ Manager::set_transient_for (Gtk::Window* parent) } } } - + current_transient_parent = parent; #endif } @@ -300,12 +300,12 @@ XMLNode& ProxyBase::get_state () const { XMLNode* node = new XMLNode (X_("Window")); - char buf[32]; + char buf[32]; node->add_property (X_("name"), _name); if (_window && vistracker) { - + /* we have a window, so use current state */ _visible = vistracker->partially_visible (); @@ -316,7 +316,7 @@ ProxyBase::get_state () const } node->add_property (X_("visible"), _visible? X_("yes") : X_("no")); - + snprintf (buf, sizeof (buf), "%d", _x_off); node->add_property (X_("x-off"), buf); snprintf (buf, sizeof (buf), "%d", _y_off); @@ -371,7 +371,7 @@ ProxyBase::setup () } set_session(_session); } - + void ProxyBase::show () { diff --git a/gtk2_ardour/window_manager.h b/gtk2_ardour/window_manager.h index 40591f84ba..6e89be3b26 100644 --- a/gtk2_ardour/window_manager.h +++ b/gtk2_ardour/window_manager.h @@ -74,7 +74,7 @@ class Manager : public ARDOUR::SessionHandlePtr static Manager* _instance; }; - + class ProxyBase : public ARDOUR::SessionHandlePtr, public sigc::trackable { public: ProxyBase (const std::string& name, const std::string& menu_name); @@ -126,7 +126,7 @@ class ProxyBase : public ARDOUR::SessionHandlePtr, public sigc::trackable { void setup (); }; - + class ProxyTemporary: public ProxyBase { public: ProxyTemporary (const std::string& name, Gtk::Window* win); @@ -143,16 +143,16 @@ class ProxyTemporary: public ProxyBase { ARDOUR::SessionHandlePtr* session_handle (); }; - + template class ProxyWithConstructor: public ProxyBase { public: ProxyWithConstructor (const std::string& name, const std::string& menu_name, const boost::function& c) : ProxyBase (name, menu_name) , creator (c) {} - + ProxyWithConstructor (const std::string& name, const std::string& menu_name, const boost::function& c, const XMLNode* node) : ProxyBase (name, menu_name, *node) , creator (c) {} - + Gtk::Window* get (bool create = false) { if (!_window) { if (!create) { @@ -163,7 +163,7 @@ class ProxyWithConstructor: public ProxyBase { if (_window) { setup (); - } + } } return _window; @@ -199,7 +199,7 @@ class Proxy : public ProxyBase { Proxy (const std::string& name, const std::string& menu_name, const XMLNode* node) : ProxyBase (name, menu_name, *node) {} - + Gtk::Window* get (bool create = false) { if (!_window) { if (!create) { @@ -210,7 +210,7 @@ class Proxy : public ProxyBase { if (_window) { setup (); - } + } } return _window; diff --git a/gtk2_ardour/windows_vst_plugin_ui.cc b/gtk2_ardour/windows_vst_plugin_ui.cc index e8bb51cb1c..5281890963 100644 --- a/gtk2_ardour/windows_vst_plugin_ui.cc +++ b/gtk2_ardour/windows_vst_plugin_ui.cc @@ -86,10 +86,10 @@ WindowsVSTPluginUI::forward_key_event (GdkEventKey* ev) /* buffer full */ return; } - + int special_windows_key = 0; int character_windows_key = 0; - + switch (ev->keyval) { case GDK_Left: special_windows_key = 0x25; @@ -111,11 +111,11 @@ WindowsVSTPluginUI::forward_key_event (GdkEventKey* ev) character_windows_key = ev->keyval; break; } - + fst->pending_keys[fst->n_pending_keys].special = special_windows_key; fst->pending_keys[fst->n_pending_keys].character = character_windows_key; fst->n_pending_keys++; - + pthread_mutex_unlock (&fst->lock); } diff --git a/gtk2_ardour/windows_vst_plugin_ui.h b/gtk2_ardour/windows_vst_plugin_ui.h index 2fa0bbc705..8b366b7da6 100644 --- a/gtk2_ardour/windows_vst_plugin_ui.h +++ b/gtk2_ardour/windows_vst_plugin_ui.h @@ -33,7 +33,7 @@ public: void forward_key_event (GdkEventKey *); private: - + int get_XID (); - + }; diff --git a/headless/load_session.cc b/headless/load_session.cc index 453522459d..cce6a0ef5a 100644 --- a/headless/load_session.cc +++ b/headless/load_session.cc @@ -178,7 +178,7 @@ int main (int argc, char* argv[]) } Session* s = 0; - + try { s = load_session (argv[optind], argv[optind+1]); } catch (failed_constructor& e) { @@ -196,7 +196,7 @@ int main (int argc, char* argv[]) } s->request_transport_speed (1.0); - + sleep (-1); AudioEngine::instance()->remove_session (); diff --git a/headless/misc.cc b/headless/misc.cc index a18989bee4..fd7f66025d 100644 --- a/headless/misc.cc +++ b/headless/misc.cc @@ -7,7 +7,7 @@ void TestReceiver::receive (Transmitter::Channel chn, const char * str) { const char *prefix = ""; - + switch (chn) { case Transmitter::Error: prefix = ": [ERROR]: "; @@ -25,13 +25,13 @@ TestReceiver::receive (Transmitter::Channel chn, const char * str) /* this isn't supposed to happen */ abort (); } - + /* note: iostreams are already thread-safe: no external lock required. */ - + std::cout << prefix << str << std::endl; - + if (chn == Transmitter::Fatal) { ::exit (9); } 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 ¶mInfo = 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 #include @@ -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) - + 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(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(mGetParamProc) (mConnInstanceStorage, inID, scope, element, &outValue); - } + } return AudioUnitGetParameter(mUnit, inID, scope, element, &outValue); } @@ -99,10 +99,10 @@ public: if (mSetParamProc != NULL) { return reinterpret_cast(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(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(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(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(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(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 #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&); 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_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 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 _envelope_active; PBD::Property _default_fade_in; PBD::Property _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 > d, Ptr o, Ptr c) : PBD::SharedStatefulProperty (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 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 _mute_master; - + static bool panners_legal; static PBD::Signal0 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 > 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 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 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& 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_factory (XMLNode const &); - + boost::shared_ptr 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() 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, 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 last_range () const { return Evoral::Range (_last_position, _last_position + _last_length - 1); } - + Evoral::Range range () const { return Evoral::Range (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 _sync_marked; @@ -366,15 +366,15 @@ class LIBARDOUR_API Region PBD::Property _position; /** Sync position relative to the start of our file */ PBD::Property _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 _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); 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 > EdgeMap; - + void add (GraphVertex from, GraphVertex to, bool via_sends_only); bool has (GraphVertex from, GraphVertex to, bool* via_sends_only); std::set 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 > 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) 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 MTCSyncStateChanged; - PBD::Signal1 LTCSyncStateChanged; + PBD::Signal1 LTCSyncStateChanged; /* Record status signals */ @@ -362,7 +362,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* Timecode state signals */ PBD::Signal0 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(&_mtc_active)); } bool synced_to_ltc () const { return config.get_external_sync() && Config->get_sync_source() == LTC && g_atomic_int_get (const_cast(&_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 SendFeedback; /* Speakers */ @@ -1025,7 +1025,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop boost::shared_ptr scene_in () const; boost::shared_ptr scene_out () const; - + boost::shared_ptr midi_clock_output_port () const; boost::shared_ptr midi_clock_input_port () const; boost::shared_ptr 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 _range_selection; Evoral::Range _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 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 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 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 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 _rec_enable_control; - + framecnt_t check_initial_delay (framecnt_t nframes, framepos_t&); private: virtual boost::shared_ptr 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* 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* 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 >::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 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 wf_region; boost::shared_ptr 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 (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 r, Evoral::Range a) : region (r), range (a) {} - + boost::shared_ptr region; ///< the region Evoral::Range 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 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 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(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 AudioEngine::available_backends() const { vector 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 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 src = boost::dynamic_pointer_cast (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 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(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 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(li->second)->drop_references (); } @@ -288,7 +288,7 @@ Automatable::get_parameter_automation_state (Evoral::Parameter param) AutoState result = Off; boost::shared_ptr 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 (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 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 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::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::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 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 tr = boost::dynamic_pointer_cast (*i); if (!tr) { @@ -350,7 +350,7 @@ Butler::flush_tracks_to_disk_normal (boost::shared_ptr rl, uint32_t& } return disk_work_outstanding; -} +} bool Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr rl, uint32_t& errors) @@ -360,7 +360,7 @@ Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr 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 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::iterator p = control_protocols.begin(); p != control_protocols.end(); ++p) { delete *p; } - + control_protocols.clear (); - + for (list::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::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, 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 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 (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 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::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, SourceList& nsrcs, s sample_rate = session.frame_rate(); } else { boost::shared_ptr aregion = boost::dynamic_pointer_cast(region); - + if (aregion) { sample_rate = aregion->audio_source()->sample_rate(); } else { return -1; } } - + nsrcs.push_back (boost::dynamic_pointer_cast ( 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 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(*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 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 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 InstrumentInfo::get_patches (uint8_t channel) @@ -164,7 +164,7 @@ InstrumentInfo::plugin_programs_to_channel_name_set (boost::shared_ptr 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 presets = pp->get_presets (); std::vector::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 (new Patch ((*i).label, n))); @@ -202,7 +202,7 @@ InstrumentInfo::plugin_programs_to_channel_name_set (boost::shared_ptrset_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 p, uint16_t boost::shared_ptr insert = boost::dynamic_pointer_cast (p); if (insert) { boost::shared_ptr 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::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 a, boost::shared_ptr 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, 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: / */ - + 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, "\n"); success = vstfx_call_dispatcher(vstfx, effGetProductString, 0, 0, productString, 0); - + if(success == 1) { fprintf (f, " \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, " \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, " \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 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::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 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 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 MidiDiskstream::get_gui_feed_buffer () const { boost::shared_ptr 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::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::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::flush (framepos_t /*start*/, framepos_t end) assert (success); ev_time = *(reinterpret_cast((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 (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 ds) */ boost::shared_ptr mds = boost::dynamic_pointer_cast (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 mp = boost::dynamic_pointer_cast (*p); if (mp) { @@ -952,7 +952,7 @@ MidiTrack::set_monitoring (MonitorChoice mc) } boost::shared_ptr 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 ports; AsyncMIDIPort* p; - + if ((p = dynamic_cast (_session.midi_input_port()))) { ports.push_back (p); } - - + + if ((p = dynamic_cast (_session.mmc_input_port()))) { ports.push_back (p); } @@ -117,11 +117,11 @@ MidiControlUI::reset_ports () if ((p = dynamic_cast (_session.scene_input_port()))) { ports.push_back (p); } - + if (ports.empty()) { return; } - + for (vector::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 r) pending_contents_change = false; RegionAdded (boost::weak_ptr (r)); /* EMIT SIGNAL */ ContentsChanged (); /* EMIT SIGNAL */ - + } } @@ -603,7 +603,7 @@ Playlist::flush_notifications (bool from_undo) remove_dependents (*s); RegionRemoved (boost::weak_ptr (*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 (*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 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 Playlist::find_regions_at (framepos_t frame) { /* Caller must hold lock */ - + boost::shared_ptr 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 Playlist::regions_touched_locked (framepos_t start, framepos_t end) { boost::shared_ptr 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 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 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, 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 (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 (new AudioPlaylist (s, name, hidden)); else if (type == DataType::MIDI) pl = boost::shared_ptr (new MidiPlaylist (s, name, hidden)); - + if (pl && !hidden) { PlaylistCreated (pl, false); } - + return pl; } catch (...) { return boost::shared_ptr (); @@ -86,7 +86,7 @@ PlaylistFactory::create (boost::shared_ptr old, string name, boo boost::shared_ptr pl; boost::shared_ptr apl; boost::shared_ptr mpl; - + try { if ((apl = boost::dynamic_pointer_cast (old)) != 0) { @@ -100,12 +100,12 @@ PlaylistFactory::create (boost::shared_ptr old, string name, boo if (pl && !hidden) { PlaylistCreated (pl, false); } - + return pl; } catch (...) { return boost::shared_ptr (); } - + } boost::shared_ptr @@ -123,9 +123,9 @@ PlaylistFactory::create (boost::shared_ptr old, framepos_t start pl = boost::shared_ptr (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 (); 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->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 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 c; - + get_connections (c); for (vector::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 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 writer (ports); boost::shared_ptr p = writer.get_copy(); Ports::iterator x = p->find (old_relative_name); - + if (x != p->end()) { boost::shared_ptr 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 ap = boost::dynamic_pointer_cast (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) 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) if (i != _all_ports.end()) { _all_ports.erase(i); } - + for (std::vector::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 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 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 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 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, 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 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) update_region_name_number_map (region); Glib::Threads::Mutex::Lock lm (region_name_maps_mutex); - + map::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 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 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 (*i)) { continue; } - + if (state) { (*i)->activate (); } else { @@ -3105,9 +3105,9 @@ Route::remove_aux_or_listen (boost::shared_ptr route) again: for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ++x) { - + boost::shared_ptr d = boost::dynamic_pointer_cast(*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, 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, pfram boost::shared_ptr 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, 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 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, 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 (); } - + 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::const_iterator j = i->second.begin(); j != i->second.end(); ++j) { @@ -197,7 +197,7 @@ ARDOUR::topological_sort ( ) { boost::shared_ptr 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 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 p, boost::shared_ptr 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 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 inputs; EngineStateController::instance()->get_physical_audio_inputs(inputs); - + how_many = inputs.size(); - + list > 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 > 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 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 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 r = routes.reader (); PBD::Unwinder 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 p = _monitor_out->input()->ports().nth_audio_port (n); boost::shared_ptr 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 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 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 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 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 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 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 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 r) /* Attempt a topological sort of the route graph */ boost::shared_ptr 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 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 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::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 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 midi_port_states; EngineStateController::instance()->get_physical_midi_input_states (midi_port_states); - + std::vector::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 (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 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::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 mt = boost::dynamic_pointer_cast (*r); @@ -3812,11 +3812,11 @@ Session::set_exclusive_input_active (boost::shared_ptr 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 mt = boost::dynamic_pointer_cast (*r); @@ -4136,13 +4136,13 @@ Session::add_source (boost::shared_ptr source) /* yay, new source */ boost::shared_ptr fs = boost::dynamic_pointer_cast (source); - + if (fs) { if (!fs->within_session()) { ensure_search_path_includes (Glib::path_get_dirname (fs->path()), fs->type()); } } - + set_dirty(); boost::shared_ptr afs; @@ -4238,7 +4238,7 @@ Session::midi_source_by_path (const std::string& path) const = boost::dynamic_pointer_cast(s->second); boost::shared_ptr fs = boost::dynamic_pointer_cast(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::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::iterator i; uint32_t existing = 0; - + for (vector::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 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 ( SourceFactory::createWritable ( @@ -4634,23 +4634,23 @@ Session::create_midi_source_by_stealing_name (boost::shared_ptr 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 mt = boost::dynamic_pointer_cast (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 (); } - + 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 (-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 (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 tr) const { vector > pl; get (pl); - + vector > pl_tr; for (vector >::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 rl, bool yn, bool grou if ((*i)->is_auditioner ()) { // REQUIRES REVIEW Can audiotioner be in Record Safe mode? continue; } - + boost::shared_ptr t; - + if ((t = boost::dynamic_pointer_cast(*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 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 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(_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 rl = routes.reader(); - + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*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 ap (new AudioPlaylistSource (s, node)); - + if (setup_peakfile (ap, true)) { return boost::shared_ptr(); } @@ -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 (*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(*i)) = *(dynamic_cast(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(*i)) = *(dynamic_cast(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(*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 (*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(*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(*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(*i)) != 0) { tempo = t; // cerr << "NEW TEMPO, frame = " << (*i)->frame() << " start = " << (*i)->start() < 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(*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(*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::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 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 { flags.set (flag); } - + /// Prints debug output if \a context contains flags that are not supported by this class template void check_flags (SelfType & self, ProcessContext context) { if (!Debuggable::debug_level (DebugFlags)) { return; } FlagField unsupported = flags.unsupported_flags_of (context.flags()); - + for (FlagField::iterator it = unsupported.begin(); it != unsupported.end(); ++it) { Debuggable::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 { 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 @@ -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::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 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::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::EndOfInput); } ListedSource::output (c_out); } - + if (frames_left) { // Copy the rest of the data TypeUtils::copy (&context.data()[input_position], &buffer[position], frames_left); position += frames_left; } - + if (context.has_flag (ProcessContext::EndOfInput) && position > 0) { ProcessContext c_out (context, buffer, position); ListedSource::output (c_out); } } using Sink::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 > 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 > 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)); } } - + /// 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 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::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 c_out (c, buffer, frames_per_channel, 1); (*it)->process (c_out); } } - + using Sink::process; - + private: void reset () @@ -98,7 +98,7 @@ class /*LIBAUDIOGRAPHER_API*/ DeInterleaver channels = 0; max_frames = 0; } - + std::vector 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 > (inputs[channel]); } - + private: class Input : public Sink @@ -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 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::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 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 c_out (c, buffer, ready_frames, channels); @@ -142,7 +142,7 @@ class /*LIBAUDIOGRAPHER_API*/ Interleaver typedef boost::shared_ptr InputPtr; std::vector 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 const & c); - + /// Process a non-const ProcsesContext in-place \n RT safe void process (ProcessContext & 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, 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, public Si peak = Routines::compute_peak (c.data(), c.frames(), peak); ListedSource::output(c); } - + using Sink::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 const & c_in); - + /// This version is only different in the case when \a TOut = float, and float clipping is on. void process (ProcessContext & 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::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::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 c_copy (c); if (has_data) { // There will be more output, so remove flag c_copy().remove_flag (ProcessContext::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 c_out (c, &c.data()[frame_index], c.frames() - frame_index); ListedSource::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::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::output (c); } - + // Finally, if in end, add silence to end if (in_end && add_to_end) { c.set_flag (ProcessContext::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 const & c, framecnt_t & total_frames, bool adding_to_end = false) { bool end_of_input = c.has_flag (ProcessContext::EndOfInput); c.remove_flag (ProcessContext::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 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, public Sink typedef std::vector::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, public Sink , readers (0) , wait_timeout (wait_timeout_milliseconds) { } - + virtual ~Threader () {} - + /// Adds output \n RT safe void add_output (typename Source::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::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 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::process; - + private: void wait() @@ -93,12 +93,12 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source, public Sink } wait_mutex.unlock(); - + if (exception) { throw *exception; } } - + void process_output(ProcessContext const & c, unsigned int output) { try { @@ -109,7 +109,7 @@ class /*LIBAUDIOGRAPHER_API*/ Threader : public Source, public Sink 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, public Sink Glib::Threads::Cond wait_cond; gint readers; long wait_timeout; - + Glib::Threads::Mutex exception_mutex; boost::shared_ptr 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 const & other) : Throwing(), _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 ProcessContext (ProcessContext const & other, T * data, framecnt_t frames, ChannelCount channels) : Throwing(), _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 ProcessContext (ProcessContext const & other, T * data, framecnt_t frames) : Throwing(), _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 ProcessContext (ProcessContext const & other, T * data) : Throwing(), _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 (new T[frames], frames, channels) {} - + /// Allocates and copies data from raw buffer AllocatingProcessContext (T const * data, framecnt_t frames, ChannelCount channels) : ProcessContext (new T[frames], frames, channels) { TypeUtils::copy (data, ProcessContext::_data, frames); } - + /// Copy constructor, copies data from other ProcessContext AllocatingProcessContext (ProcessContext const & other) : ProcessContext (other, new T[other._frames]) { TypeUtils::copy (ProcessContext::_data, other._data, other._frames); } - + /// "Copy constructor" with uninitialized data, unique frame and channel count, but copies flags template AllocatingProcessContext (ProcessContext const & other, framecnt_t frames, ChannelCount channels) : ProcessContext (other, new T[frames], frames, channels) {} - + /// "Copy constructor" with uninitialized data, unique frame count, but copies channel count and flags template AllocatingProcessContext (ProcessContext const & other, framecnt_t frames) : ProcessContext (other, new T[frames], frames, other.channels()) {} - + /// "Copy constructor" uninitialized data, that copies frame and channel count + flags template AllocatingProcessContext (ProcessContext const & other) : ProcessContext (other, new T[other._frames]) {} - + ~AllocatingProcessContext () { delete [] ProcessContext::_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(data), frames, channels) {} - + /// Copy constructor from const ProcessContext ConstProcessContext (ProcessContext const & other) : context (const_cast &> (other)) {} - + /// "Copy constructor", with unique data, frame and channel count, but copies flags template ConstProcessContext (ProcessContext const & other, T const * data, framecnt_t frames, ChannelCount channels) : context (other, const_cast(data), frames, channels) {} - + /// "Copy constructor", with unique data and frame count, but copies channel count and flags template ConstProcessContext (ProcessContext const & other, T const * data, framecnt_t frames) : context (other, const_cast(data), frames) {} - + /// "Copy constructor", with unique data, but copies frame and channel count + flags template 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 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 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 class Sndfile : public SndfileWriter, public SndfileReader { 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 c_out = context.beginning (frames_read); - + if (frames_read < context.frames()) { c_out.set_flag (ProcessContext::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 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::process; - + PBD::Signal1 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 > 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 static void do_zero_fill(T * buffer, framecnt_t frames, const boost::integral_constant&) { std::uninitialized_fill_n (buffer, frames, T()); } @@ -32,7 +32,7 @@ template class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase { BOOST_STATIC_ASSERT (boost::has_trivial_destructor::value); - + typedef boost::integral_constant::value || boost::is_signed::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 void add_output (typename Source::SinkPtr output) { outputs.push_back(output); } void clear_outputs () { outputs.clear(); } void remove_output (typename Source::SinkPtr output) { outputs.remove(output); } - + protected: - + typedef std::list::SinkPtr> SinkList; - + /// Helper for derived classes void output (ProcessContext 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 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 c_out (c, buffer); ListedSource::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::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::process (ProcessContext 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::process (ProcessContext & 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::process (ProcessContext 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::copy (c_in.data(), data_out, c_in.frames()); - + ProcessContext c (c_in, data_out); process (c); } @@ -200,7 +200,7 @@ SampleFormatConverter::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 const & c) { check_flags (*this, c); - + if (!active) { output (c); return; @@ -158,7 +158,7 @@ SampleRateConverter::process (ProcessContext 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 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::EndOfInput)) { set_end_of_input (c); @@ -205,10 +205,10 @@ SampleRateConverter::process (ProcessContext const & c) void SampleRateConverter::set_end_of_input (ProcessContext const & c) { src_data.end_of_input = true; - + float f; ProcessContext 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 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 const half_context (random_data, frames / 2, 1); ProcessContext 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()); - + assert (frames % 2 == 0); chunker.reset (new Chunker(frames / 4)); - + chunker->add_output (sink); framecnt_t frames_output = 0; - + ProcessContext const half_context (random_data, frames / 2, 1); ProcessContext 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 > grabber(new ProcessContextGrabber()); - + assert (frames % 2 == 0); chunker.reset (new Chunker(frames)); chunker->add_output (grabber); - + ProcessContext const half_context (random_data, frames / 2, 1); ProcessContext 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 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 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 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()); interleaver.reset (new Interleaver()); - + sink_a.reset (new VectorSink()); sink_b.reset (new VectorSink()); sink_c.reset (new VectorSink()); @@ -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 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 c_a (random_data_a, frames_per_channel, 1); ProcessContext c_b (random_data_b, frames_per_channel, 1); ProcessContext 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; boost::shared_ptr > deinterleaver; - + boost::shared_ptr > sink_a; boost::shared_ptr > sink_b; boost::shared_ptr > 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()); sink.reset (new VectorSink()); - + interleaver->init (channels, frames); } @@ -50,7 +50,7 @@ class InterleaverTest : public CppUnit::TestFixture { ProcessContext 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 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()); - + ProcessContext 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 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 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 > converter (new SampleFormatConverter(1)); boost::shared_ptr > sink (new VectorSink()); - + converter->init (frames, D_Tri, 32); converter->add_output (sink); framecnt_t frames_output = 0; - + { ProcessContext pc(random_data, frames / 2, 1); converter->process (pc); frames_output = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames / 2, frames_output); } - + { ProcessContext pc(random_data, frames, 1); converter->process (pc); frames_output = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames, frames_output); } - + { ProcessContext 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 > converter (new SampleFormatConverter(1)); boost::shared_ptr > sink (new VectorSink()); framecnt_t frames_output = 0; - + converter->init(frames, D_Tri, 32); converter->add_output (sink); - + converter->set_clip_floats (false); ProcessContext 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 > converter (new SampleFormatConverter(1)); boost::shared_ptr > sink (new VectorSink()); framecnt_t frames_output = 0; - + converter->init(frames, D_Tri, 32); converter->add_output (sink); - + ProcessContext 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 > converter (new SampleFormatConverter(1)); boost::shared_ptr > sink (new VectorSink()); framecnt_t frames_output = 0; - + converter->init(frames, D_Tri, 24); converter->add_output (sink); - + ProcessContext 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 > converter (new SampleFormatConverter(1)); boost::shared_ptr > sink (new VectorSink()); framecnt_t frames_output = 0; - + converter->init(frames, D_Tri, 16); converter->add_output (sink); - + ProcessContext 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 > converter (new SampleFormatConverter(1)); boost::shared_ptr > sink (new VectorSink()); framecnt_t frames_output = 0; - + converter->init(frames, D_Tri, 8); converter->add_output (sink); - + ProcessContext 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 > converter (new SampleFormatConverter(3)); boost::shared_ptr > sink (new VectorSink()); framecnt_t frames_output = 0; - + converter->init(frames, D_Tri, 32); converter->add_output (sink); - + ProcessContext pc(random_data, 4, 1); CPPUNIT_ASSERT_THROW (converter->process (pc), Exception); - + framecnt_t new_frame_count = frames - (frames % 3); converter->process (ProcessContext (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 (frames / 2)); sink.reset (new AppendingVectorSink()); - + 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 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 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 c (zero_data, frames, 1); trimmer->process (c); framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames, frames_processed); } - + { ProcessContext 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 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 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 c (zero_data, frames, 1); trimmer->process (c); framecnt_t frames_processed = sink->get_data().size(); CPPUNIT_ASSERT_EQUAL (frames / 2, frames_processed); } - + { ProcessContext 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 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 c (random_data, frames, 1); trimmer->process (c); } - + { ProcessContext c (random_data, frames, 1); c.set_flag (ProcessContext::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 c (random_data, half_frames, 1); converter->process (c); ProcessContext c2 (&random_data[half_frames], half_frames, 1); c2.set_flag (ProcessContext::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 c (random_data, half_frames, 1); converter->process (c); ProcessContext 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 c (random_data, half_frames, 1); converter->process (c); ProcessContext c2 (&random_data[half_frames], half_frames, 1); c2.set_flag (ProcessContext::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 c (random_data, half_frames, 1); converter->process (c); ProcessContext c2 (&random_data[half_frames], half_frames / 2, 1); c2.set_flag (ProcessContext::EndOfInput); converter->process (c2); - + for (std::list >::iterator it = grabber->contexts.begin(); it != grabber->contexts.end(); ++it) { std::list >::iterator next = it; ++next; if (next == grabber->contexts.end()) { @@ -115,7 +115,7 @@ class SampleRateConverterTest : public CppUnit::TestFixture } } } - + private: boost::shared_ptr 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 (*thread_pool)); - + sink_a.reset (new VectorSink()); sink_b.reset (new VectorSink()); sink_c.reset (new VectorSink()); sink_d.reset (new VectorSink()); sink_e.reset (new VectorSink()); sink_f.reset (new VectorSink()); - + throwing_sink.reset (new ThrowingSink()); } @@ -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 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 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 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 c (random_data, frames, 1); threader->process (c); - + threader->clear_outputs(); ProcessContext 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 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; boost::shared_ptr > sink_a; boost::shared_ptr > sink_b; @@ -144,7 +144,7 @@ class ThreaderTest : public CppUnit::TestFixture boost::shared_ptr > sink_d; boost::shared_ptr > sink_e; boost::shared_ptr > sink_f; - + boost::shared_ptr > 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 c (random_data, frames, channels); c.set_flag (ProcessContext::EndOfInput); file->process (c); - + TypeUtils::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::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::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::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::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 contexts.push_back (c); } using AudioGrapher::Sink::process; - + typedef std::list > 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()); vertex->add_output (sink_a); vertex->add_output (sink_b); - + framecnt_t frames_output = 0; - + ProcessContext 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()); vertex->add_output (sink_a); vertex->add_output (sink_b); - + ProcessContext c (random_data, frames, 1); vertex->process (c); - + vertex->remove_output (sink_a); ProcessContext 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()); vertex->add_output (sink_a); vertex->add_output (sink_b); - + ProcessContext c (random_data, frames, 1); vertex->process (c); - + vertex->clear_outputs (); ProcessContext 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::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::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())); } - + /* 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::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 JACKAudioBackend::available_sample_rates (const string& device) const { vector 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 JACKAudioBackend::available_buffer_sizes (const string& device) const { vector 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 f; size_t stacksize; - + ThreadData (JACKAudioBackend* e, boost::function 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(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 inline T WUMin(const T &a, const T &b) {return (a < b) ? a : b;} // requires only < to be defined for T template inline T WUMax(const T &a,const T &b) {return (a < b) ? b : a;} // requires only < to be defined for T template 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 inline T WUMin(T a,T b) {return (a < b) ? a : b;} // requires only < to be defined for T template inline T WUMax(T a,T b) {return (a < b) ? b : a;} // requires only < to be defined for T @@ -51,7 +51,7 @@ template 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(in_uint)); // } -// +// // WCFixedStringBase& operator<<(const size_t in_uint) { // return operator<<(static_cast(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(in_uint)); } #endif -// +// #if defined(PLATFORM_WINDOWS) || defined(__linux__) // both 32 & 64 bit WCFixedStringBase& operator<<(const unsigned long in_uint) { return operator<<(static_cast(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 class WCFixedStringPair : public std::pair< WCFixedString, WCFixedString > { 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, WCFixedString >(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, WCFixedString >(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, WCFixedString >(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 #include #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 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& 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();///& InputLevels();///& OutputLevels();/// m_InputChannels; ///< List of input channel names. std::vector m_OutputChannels; ///< List of output channel names. std::vector m_SamplingRates; ///< List of available sampling rates. std::vector 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 m_InputLevels; ///< List of input levels. std::vector 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);///& 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::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 " <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& 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& 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);/// 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 const & renders = canvas.renders (); - + for (list::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 const & context #endif render_count = 0; - + boost::optional 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 const & context boost::optional 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 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 pre_change_bounding_box) boost::optional 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 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::const_iterator i; list 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 (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 (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 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 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(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 > StopList; - + void set_gradient (StopList const & stops, bool is_vertical); void set_pattern (Cairo::RefPtr); 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 > 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) 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) 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&, 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 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 (); } - + return boost::optional (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 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(&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 region; /* resulting image, after request has been satisfied */ - + Cairo::RefPtr 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 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, boost::shared_ptr); void use (boost::shared_ptr, boost::shared_ptr); - + void consolidate_image_cache (boost::shared_ptr, int channel, Coord height, @@ -196,18 +196,18 @@ public: Cairo::RefPtr _image; PBD::Signal0 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 get_image (framepos_t start, framepos_t end, bool& full_image) const; boost::shared_ptr 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&, ARDOUR::PeakData*, int n_peaks, boost::shared_ptr) const; void draw_absent_image (Cairo::RefPtr&, ARDOUR::PeakData*, int) const; - + void cancel_my_render_request () const; void queue_get_image (boost::shared_ptr region, framepos_t start, framepos_t end) const; @@ -394,7 +394,7 @@ public: mutable boost::shared_ptr _current_image; mutable boost::shared_ptr 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) 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 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 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::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 context, Rect const & self, Duple const & draw_origin) const { Cairo::RefPtr _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 context) const _pending->stride); _current = _pending; } - + Rect self = item_to_window (Rect (0, 0, _width, _height)); boost::optional 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 (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 context) #endif ++render_depth; - + for (std::vector::const_iterator i = items.begin(); i != items.end(); ++i) { if (!(*i)->visible ()) { @@ -756,7 +756,7 @@ Item::render_children (Rect const & area, Cairo::RefPtr context) #endif continue; } - + boost::optional item_bbox = (*i)->bounding_box (); if (!item_bbox) { @@ -767,10 +767,10 @@ Item::render_children (Rect const & area, Cairo::RefPtr context) #endif continue; } - + Rect item = (*i)->item_to_window (item_bbox.get(), false); boost::optional 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 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::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 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 context) const } boost::optional 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 OptimizingLookupTable::get (Rect const & area) @@ -321,7 +321,7 @@ OptimizingLookupTable::get (Rect const & area) vector 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 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 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 (); } - + _bounding_box_dirty = false; } @@ -113,14 +113,14 @@ PolyItem::render_curve (Rect const & area, Cairo::RefPtr 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 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 context, Rect self) const { boost::optional r = self.intersection (area); - + if (!r) { return; } @@ -89,11 +89,11 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr 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 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 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 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 cr) const cr->stroke (); /* draw ticks + text */ - + Glib::RefPtr 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 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 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 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 context) Rect self = item_to_window (Rect (0, 0, image->get_width(), image->get_height())); boost::optional 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 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::iterator j = rectangles.begin(); j != rectangles.end(); ++j) { boost::optional 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 (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 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::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 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 context) const Rect self = item_to_window (Rect (0, 0, min (_clamped_width, (double)_image->get_width ()), _image->get_height ())); boost::optional i = self.intersection (area); - + if (!i) { return; } @@ -181,7 +181,7 @@ Text::render (Rect const & area, Cairo::RefPtr 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& 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& 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& 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& image, PeakData* _peak if (req->should_stop()) { return; } - + Cairo::RefPtr 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& 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 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 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 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 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 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 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 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(this)->ImageReady (); /* emit signal */ @@ -1040,7 +1040,7 @@ void WaveView::render (Rect const & area, Cairo::RefPtr context) const { assert (_samples_per_pixel != 0); - + if (!_region) { return; } @@ -1064,11 +1064,11 @@ WaveView::render (Rect const & area, Cairo::RefPtr 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 d = self.intersection (area); @@ -1082,17 +1082,17 @@ WaveView::render (Rect const & area, Cairo::RefPtr 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 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 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 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 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 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 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 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 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 (); @@ -1611,14 +1611,14 @@ WaveViewCache::lookup_image (boost::shared_ptr src, CacheLine& caches = x->second; boost::shared_ptr 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 e (*c); - + if (channel != e->channel || height != e->height || amplitude != e->amplitude @@ -1673,7 +1673,7 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr 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 s ++nxt; boost::shared_ptr e1 (*c1); - + if (channel != e1->channel || height != e1->height || amplitude != e1->amplitude @@ -1696,12 +1696,12 @@ WaveViewCache::consolidate_image_cache (boost::shared_ptr 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 s ++nxt2; boost::shared_ptr 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 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 src, boost::shared_ptr ce) { /* MUST BE CALLED FROM (SINGLE) GUI THREAD */ - + Cairo::RefPtr 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 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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms->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, ¶ms); /* 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, ¶ms, x, y, width, height); } else if (DETAIL ("frame") && widget && GE_IS_STATUSBAR (widget->parent)) { WidgetParameters params; - + clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); gtk_style_apply_default_background (style, window, TRUE, state_type, area, x, y, width, height); - + STYLE_FUNCTION (draw_statusbar) (cr, colors, ¶ms, 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, ¶ms); 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, ¶ms, &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, ¶ms); params.corners = CR_CORNER_ALL; - + STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &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, ¶ms); 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, ¶ms, &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, ¶ms); - + 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, ¶ms, &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, ¶ms); 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, ¶ms, &toolbar, x, y, width, height); cairo_restore (cr); } - + STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &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, ¶ms); handle.type = CL_HANDLE_SPLITTER; handle.horizontal = orientation == GTK_ORIENTATION_HORIZONTAL; - + STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &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, ¶ms); 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, ¶ms, &toolbar, x, y, width, height); cairo_restore (cr); } - + STYLE_FUNCTION(draw_handle) (cr, colors, ¶ms, &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, ¶ms); 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, ¶ms); - + 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, ¶ms, &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, ¶ms, x, y, width, height); } @@ -572,14 +572,14 @@ clearlooks_style_draw_box (DRAW_ARGS) { WidgetParameters params; clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); - + 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, ¶ms, x, y, width, height); } } else if (DETAIL ("spinbutton")) { WidgetParameters params; - + clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); - + 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, ¶ms, 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, ¶ms); 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, ¶ms, &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, ¶ms); - + + clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); + STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, ¶ms, 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, ¶ms); 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, ¶ms, &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, ¶ms, &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, ¶ms); - + 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, ¶ms, &optionmenu, - x, y, width, height); + x, y, width, height); } else if (DETAIL ("menuitem")) { WidgetParameters params; clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); - + 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, ¶ms, x, y, width, height); } else - { + { params.corners = CR_CORNER_ALL; STYLE_FUNCTION(draw_menuitem) (cr, colors, ¶ms, 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, ¶ms); 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, ¶ms, &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, ¶ms); - + STYLE_FUNCTION(draw_menu_frame) (cr, colors, ¶ms, 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, ¶ms); - + 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, ¶ms, &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, ¶ms, &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, ¶ms); - + STYLE_FUNCTION(draw_radiobutton) (cr, colors, ¶ms, &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, ¶ms); - + 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, ¶ms, &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, ¶ms); params.corners = CR_CORNER_ALL; - + STYLE_FUNCTION(draw_frame) (cr, colors, ¶ms, &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, ¶ms); + clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); STYLE_FUNCTION(draw_resize_grip) (cr, colors, ¶ms, &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, ¶ms); arrow.type = CL_ARROW_COMBO; - arrow.direction = CL_DIRECTION_DOWN; + arrow.direction = CL_DIRECTION_DOWN; STYLE_FUNCTION(draw_arrow) (cr, colors, ¶ms, &arrow, x, y, width, height); @@ -1231,12 +1231,12 @@ clearlooks_style_draw_arrow (GtkStyle *style, clearlooks_set_widget_parameters (widget, style, state_type, ¶ms); 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, ¶ms, &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 (¶ms.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 +template bool operator== (Range a, Range b) { return a.from == b.from && a.to == b.to; } @@ -149,7 +149,7 @@ template class /*LIBEVORAL_API*/ RangeList { public: RangeList () : _dirty (false) {} - + typedef std::list > 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 subtract (Range range, RangeList 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::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 class LIBEVORAL_TEMPLATE_API IdentityConverter : public TimeConverter { 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 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::set_original_time (Timestamp t) { _original_time = t; } - + #endif // EVORAL_EVENT_ALLOC template class Event; 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