From 2f91bdfa5390bdf992ab7044488b5afb21716661 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 13 Apr 2019 19:19:29 +0200 Subject: NO-OP: after fixes in libs --- libs/ardour/ardour/audioengine.h | 38 +- libs/ardour/ardour/audioplaylist.h | 4 +- libs/ardour/ardour/cycles.h | 16 +- libs/ardour/ardour/export_channel.h | 14 +- libs/ardour/ardour/iec1ppmdsp.h | 2 +- libs/ardour/ardour/iec2ppmdsp.h | 2 +- libs/ardour/ardour/io_processor.h | 10 +- libs/ardour/ardour/kmeterdsp.h | 2 +- libs/ardour/ardour/midi_playlist.h | 4 +- libs/ardour/ardour/mix.h | 2 +- libs/ardour/ardour/msvc_libardour.h | 16 +- libs/ardour/ardour/note_fixer.h | 4 +- libs/ardour/ardour/playlist.h | 4 +- libs/ardour/ardour/plugin_manager.h | 4 +- libs/ardour/ardour/port.h | 2 +- libs/ardour/ardour/presentation_info.h | 9 +- libs/ardour/ardour/route.h | 2 +- libs/ardour/ardour/runtime_functions.h | 26 +- libs/ardour/ardour/soundcloud_upload.h | 8 +- libs/ardour/ardour/soundseq.h | 2 +- libs/ardour/ardour/transport_master.h | 2 +- libs/ardour/ardour/vestige/vestige.h | 8 +- libs/ardour/ardour/vumeterdsp.h | 3 +- libs/ardour/audio_unit.cc | 8 +- libs/ardour/audiofilesource.cc | 2 +- libs/ardour/audioregion.cc | 28 +- libs/ardour/export_handler.cc | 2 +- libs/ardour/export_profile_manager.cc | 3 - libs/ardour/globals.cc | 2 +- libs/ardour/io.cc | 2 - libs/ardour/parameter_descriptor.cc | 2 +- libs/ardour/plugin_manager.cc | 5 +- libs/ardour/presentation_info.cc | 12 +- libs/ardour/rc_configuration.cc | 13 +- libs/ardour/region.cc | 193 +++--- libs/ardour/route_group.cc | 24 +- libs/ardour/session.cc | 219 +++--- libs/ardour/session_configuration.cc | 13 +- libs/ardour/session_directory.cc | 6 +- libs/ardour/session_midi.cc | 9 +- libs/ardour/session_object.cc | 2 +- libs/ardour/tempo.cc | 58 +- .../coreaudio/coreaudio_pcmio_aggregate.cc | 2 +- libs/evoral/src/libsmf/smf.c | 2 +- libs/evoral/src/libsmf/smf_private.h | 12 +- libs/pbd/boost_debug.cc | 69 +- libs/pbd/convert.cc | 40 +- libs/pbd/fpu.cc | 49 +- libs/pbd/pbd.cc | 2 +- libs/pbd/pbd/compose.h | 755 ++++++++++----------- libs/pbd/pbd/msvc_pbd.h | 84 +-- libs/pbd/pbd/ringbuffer.h | 130 ++-- libs/pbd/pbd/timersub.h | 19 +- libs/pbd/pbd/tokenizer.h | 48 +- libs/pbd/xml++.cc | 5 +- libs/surfaces/faderport/gui.cc | 6 +- libs/surfaces/us2400/device_info.cc | 13 +- libs/surfaces/us2400/strip.cc | 53 +- libs/surfaces/us2400/strip.h | 2 +- libs/widgets/ardour_dropdown.cc | 1 - libs/widgets/widgets/ardour_knob.h | 2 +- libs/widgets/widgets/ardour_spacer.h | 2 +- libs/widgets/widgets/binding_proxy.h | 2 +- 63 files changed, 1039 insertions(+), 1046 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index f699e01988..4f8d7a94ba 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -264,21 +264,21 @@ class LIBARDOUR_API AudioEngine : public PortManager, public SessionHandlePtr static AudioEngine* _instance; - Glib::Threads::Mutex _process_lock; + Glib::Threads::Mutex _process_lock; Glib::Threads::RecMutex _state_lock; Glib::Threads::Cond session_removed; bool session_remove_pending; - sampleoffset_t session_removal_countdown; + sampleoffset_t session_removal_countdown; gain_t session_removal_gain; gain_t session_removal_gain_step; bool _running; bool _freewheeling; /// number of samples between each check for changes in monitor input - samplecnt_t monitor_check_interval; + samplecnt_t monitor_check_interval; /// time of the last monitor check in samples - samplecnt_t last_monitor_check; + samplecnt_t last_monitor_check; /// the number of samples processed since start() was called - samplecnt_t _processed_samples; + samplecnt_t _processed_samples; Glib::Threads::Thread* m_meter_thread; ProcessThread* _main_thread; MTDM* _mtdm; @@ -286,28 +286,28 @@ class LIBARDOUR_API AudioEngine : public PortManager, public SessionHandlePtr LatencyMeasurement _measuring_latency; PortEngine::PortHandle _latency_input_port; PortEngine::PortHandle _latency_output_port; - samplecnt_t _latency_flush_samples; + samplecnt_t _latency_flush_samples; std::string _latency_input_name; std::string _latency_output_name; - samplecnt_t _latency_signal_latency; + samplecnt_t _latency_signal_latency; bool _stopped_for_latency; bool _started_for_latency; bool _in_destructor; std::string _last_backend_error_string; - Glib::Threads::Thread* _hw_reset_event_thread; - gint _hw_reset_request_count; - Glib::Threads::Cond _hw_reset_condition; - Glib::Threads::Mutex _reset_request_lock; - gint _stop_hw_reset_processing; - Glib::Threads::Thread* _hw_devicelist_update_thread; - gint _hw_devicelist_update_count; - Glib::Threads::Cond _hw_devicelist_update_condition; - Glib::Threads::Mutex _devicelist_update_lock; - gint _stop_hw_devicelist_processing; - uint32_t _start_cnt; - uint32_t _init_countdown; + Glib::Threads::Thread* _hw_reset_event_thread; + gint _hw_reset_request_count; + Glib::Threads::Cond _hw_reset_condition; + Glib::Threads::Mutex _reset_request_lock; + gint _stop_hw_reset_processing; + Glib::Threads::Thread* _hw_devicelist_update_thread; + gint _hw_devicelist_update_count; + Glib::Threads::Cond _hw_devicelist_update_condition; + Glib::Threads::Mutex _devicelist_update_lock; + gint _stop_hw_devicelist_processing; + uint32_t _start_cnt; + uint32_t _init_countdown; void start_hw_event_processing(); void stop_hw_event_processing(); diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index e66ee0e780..9d79fe3438 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -61,6 +61,4 @@ private: } /* namespace ARDOUR */ -#endif /* __ardour_audio_playlist_h__ */ - - +#endif /* __ardour_audio_playlist_h__ */ diff --git a/libs/ardour/ardour/cycles.h b/libs/ardour/ardour/cycles.h index eed3bb452d..3b7d072946 100644 --- a/libs/ardour/ardour/cycles.h +++ b/libs/ardour/ardour/cycles.h @@ -45,7 +45,7 @@ extern cycles_t cacheflush_time; #if defined(__x86_64__) -#define rdtscll(lo, hi) \ +#define rdtscll(lo, hi) \ __asm__ __volatile__("rdtsc" : "=a" (lo), "=d" (hi)) static inline cycles_t get_cycles (void) @@ -58,7 +58,7 @@ static inline cycles_t get_cycles (void) #else -#define rdtscll(val) \ +#define rdtscll(val) \ __asm__ __volatile__("rdtsc" : "=A" (val)) static inline cycles_t get_cycles (void) @@ -80,7 +80,7 @@ static inline cycles_t get_cycles(void) #elif defined(__powerpc__) -#define CPU_FTR_601 0x00000100 +#define CPU_FTR_601 0x00000100 typedef uint32_t cycles_t; @@ -96,13 +96,13 @@ static inline cycles_t get_cycles(void) cycles_t ret = 0; __asm__ __volatile__( - "98: mftb %0\n" + "98: mftb %0\n" "99:\n" ".section __ftr_fixup,\"a\"\n" - " .long %1\n" - " .long 0\n" - " .long 98b\n" - " .long 99b\n" + " .long %1\n" + " .long 0\n" + " .long 98b\n" + " .long 99b\n" ".previous" : "=r" (ret) : "i" (CPU_FTR_601)); return ret; diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index 8f4d8fc27c..0a7aedcb86 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -183,13 +183,13 @@ class LIBARDOUR_API RouteExportChannel : public ExportChannel // Removes the processor from the track when deleted class ProcessorRemover { - public: - ProcessorRemover (boost::shared_ptr route, boost::shared_ptr processor) - : route (route), processor (processor) {} - ~ProcessorRemover(); - private: - boost::shared_ptr route; - boost::shared_ptr processor; + public: + ProcessorRemover (boost::shared_ptr route, boost::shared_ptr processor) + : route (route), processor (processor) {} + ~ProcessorRemover(); + private: + boost::shared_ptr route; + boost::shared_ptr processor; }; boost::shared_ptr processor; diff --git a/libs/ardour/ardour/iec1ppmdsp.h b/libs/ardour/ardour/iec1ppmdsp.h index b6f1501db7..ede9955a88 100644 --- a/libs/ardour/ardour/iec1ppmdsp.h +++ b/libs/ardour/ardour/iec1ppmdsp.h @@ -18,7 +18,7 @@ */ #ifndef __IEC1PPMDSP_H -#define __IEC1PPMDSP_H +#define __IEC1PPMDSP_H #include "ardour/libardour_visibility.h" diff --git a/libs/ardour/ardour/iec2ppmdsp.h b/libs/ardour/ardour/iec2ppmdsp.h index 6a3852da1d..634f670365 100644 --- a/libs/ardour/ardour/iec2ppmdsp.h +++ b/libs/ardour/ardour/iec2ppmdsp.h @@ -18,7 +18,7 @@ */ #ifndef __IEC2PPMDSP_H -#define __IEC2PPMDSP_H +#define __IEC2PPMDSP_H #include "ardour/libardour_visibility.h" diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h index c59addffb2..75e68a42aa 100644 --- a/libs/ardour/ardour/io_processor.h +++ b/libs/ardour/ardour/io_processor.h @@ -44,10 +44,12 @@ class LIBARDOUR_API IOProcessor : public Processor { public: IOProcessor (Session&, bool with_input, bool with_output, - const std::string& proc_name, const std::string io_name="", - ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false); - IOProcessor (Session&, boost::shared_ptr input, boost::shared_ptr output, - const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO); + const std::string& proc_name, const std::string io_name="", + ARDOUR::DataType default_type = DataType::AUDIO, bool sendish=false); + + IOProcessor (Session&, boost::shared_ptr input, boost::shared_ptr output, + const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO); + virtual ~IOProcessor (); bool set_name (const std::string& str); diff --git a/libs/ardour/ardour/kmeterdsp.h b/libs/ardour/ardour/kmeterdsp.h index 7fe2b9d11b..a48e60e504 100644 --- a/libs/ardour/ardour/kmeterdsp.h +++ b/libs/ardour/ardour/kmeterdsp.h @@ -18,7 +18,7 @@ */ #ifndef __KMETERDSP_H -#define __KMETERDSP_H +#define __KMETERDSP_H #include "ardour/libardour_visibility.h" diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h index 2d4e494781..53d62bff4f 100644 --- a/libs/ardour/ardour/midi_playlist.h +++ b/libs/ardour/ardour/midi_playlist.h @@ -137,6 +137,4 @@ private: } /* namespace ARDOUR */ -#endif /* __ardour_midi_playlist_h__ */ - - +#endif /* __ardour_midi_playlist_h__ */ diff --git a/libs/ardour/ardour/mix.h b/libs/ardour/ardour/mix.h index 4676c01046..a3d9cbd8b4 100644 --- a/libs/ardour/ardour/mix.h +++ b/libs/ardour/ardour/mix.h @@ -72,6 +72,6 @@ LIBARDOUR_API void default_find_peaks (const ARDOUR::Sample * bu LIBARDOUR_API void default_apply_gain_to_buffer (ARDOUR::Sample * buf, ARDOUR::pframes_t nframes, float gain); LIBARDOUR_API void default_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes, float gain); LIBARDOUR_API void default_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); -LIBARDOUR_API void default_copy_vector (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); +LIBARDOUR_API void default_copy_vector (ARDOUR::Sample * dst, const ARDOUR::Sample * src, ARDOUR::pframes_t nframes); #endif /* __ardour_mix_h__ */ diff --git a/libs/ardour/ardour/msvc_libardour.h b/libs/ardour/ardour/msvc_libardour.h index f8edcdd3cb..198af34dbe 100644 --- a/libs/ardour/ardour/msvc_libardour.h +++ b/libs/ardour/ardour/msvc_libardour.h @@ -35,13 +35,13 @@ namespace ARDOUR { #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ // LIBARDOUR_API char* LIBARDOUR_APICALLTYPE placeholder_for_non_msvc_specific_function(s); #ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +} /* extern "C" */ +#endif /* __cplusplus */ } // namespace ARDOUR @@ -58,16 +58,16 @@ namespace ARDOUR { #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ LIBARDOUR_API int LIBARDOUR_APICALLTYPE symlink(const char *dest, const char *shortcut, const char *working_directory = 0); LIBARDOUR_API int LIBARDOUR_APICALLTYPE readlink(const char *__restrict shortcut, char *__restrict buf, size_t bufsize); #ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +} /* extern "C" */ +#endif /* __cplusplus */ } // namespace ARDOUR -#endif // COMPILER_MSVC -#endif // __mavc_libardour_h__ +#endif // COMPILER_MSVC +#endif // __mavc_libardour_h__ diff --git a/libs/ardour/ardour/note_fixer.h b/libs/ardour/ardour/note_fixer.h index 4851636a65..1e028ad637 100644 --- a/libs/ardour/ardour/note_fixer.h +++ b/libs/ardour/ardour/note_fixer.h @@ -99,6 +99,4 @@ private: } /* namespace ARDOUR */ -#endif /* __ardour_note_fixer_h__ */ - - +#endif /* __ardour_note_fixer_h__ */ diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index ccc807c642..c629591420 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -426,6 +426,4 @@ private: } /* namespace ARDOUR */ -#endif /* __ardour_playlist_h__ */ - - +#endif /* __ardour_playlist_h__ */ diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 264018345d..80b578c20f 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -172,8 +172,8 @@ private: ARDOUR::PluginInfoList _empty_plugin_info; ARDOUR::PluginInfoList* _windows_vst_plugin_info; - ARDOUR::PluginInfoList* _lxvst_plugin_info; - ARDOUR::PluginInfoList* _mac_vst_plugin_info; + ARDOUR::PluginInfoList* _lxvst_plugin_info; + ARDOUR::PluginInfoList* _mac_vst_plugin_info; ARDOUR::PluginInfoList* _ladspa_plugin_info; ARDOUR::PluginInfoList* _lv2_plugin_info; ARDOUR::PluginInfoList* _au_plugin_info; diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index d053c6aee0..e2e2de1631 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -158,7 +158,7 @@ protected: PortEngine::PortHandle _port_handle; - static bool _connecting_blocked; + static bool _connecting_blocked; static pframes_t _cycle_nframes; /* access only from process() tree */ static pframes_t _global_port_buffer_offset; /* access only from process() tree */ diff --git a/libs/ardour/ardour/presentation_info.h b/libs/ardour/ardour/presentation_info.h index f5e1ed4531..08b253ac20 100644 --- a/libs/ardour/ardour/presentation_info.h +++ b/libs/ardour/ardour/presentation_info.h @@ -73,13 +73,12 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful * There are several pathways for the order being set: * * - object created during session loading from XML - * - numeric order will be set during ::set_state(), based on - * - type will be set during ctor call + * - numeric order will be set during ::set_state(), based on + * - type will be set during ctor call * * - object created in response to user request - * - numeric order will be set by Session, before adding - * to container. - * - type set during ctor call + * - numeric order will be set by Session, before adding to container. + * - type set during ctor call * * * OBJECT IDENTITY diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index a8278874b0..6a2ddcb79f 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -586,7 +586,7 @@ public: bool has_external_redirects() const; /* can only be executed by a route for which is_monitor() is true - * (i.e. the monitor out) + * (i.e. the monitor out) */ void monitor_run (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes); diff --git a/libs/ardour/ardour/runtime_functions.h b/libs/ardour/ardour/runtime_functions.h index 45d6ec7015..ac4187a1e9 100644 --- a/libs/ardour/ardour/runtime_functions.h +++ b/libs/ardour/ardour/runtime_functions.h @@ -25,19 +25,19 @@ namespace ARDOUR { - typedef float (*compute_peak_t) (const ARDOUR::Sample *, pframes_t, float); - typedef void (*find_peaks_t) (const ARDOUR::Sample *, pframes_t, float *, float*); - typedef void (*apply_gain_to_buffer_t) (ARDOUR::Sample *, pframes_t, float); - typedef void (*mix_buffers_with_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t, float); - typedef void (*mix_buffers_no_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t); - typedef void (*copy_vector_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t); - - LIBARDOUR_API extern compute_peak_t compute_peak; - LIBARDOUR_API extern find_peaks_t find_peaks; - LIBARDOUR_API extern apply_gain_to_buffer_t apply_gain_to_buffer; - LIBARDOUR_API extern mix_buffers_with_gain_t mix_buffers_with_gain; - LIBARDOUR_API extern mix_buffers_no_gain_t mix_buffers_no_gain; - LIBARDOUR_API extern copy_vector_t copy_vector; + typedef float (*compute_peak_t) (const ARDOUR::Sample *, pframes_t, float); + typedef void (*find_peaks_t) (const ARDOUR::Sample *, pframes_t, float *, float*); + typedef void (*apply_gain_to_buffer_t) (ARDOUR::Sample *, pframes_t, float); + typedef void (*mix_buffers_with_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t, float); + typedef void (*mix_buffers_no_gain_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t); + typedef void (*copy_vector_t) (ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t); + + LIBARDOUR_API extern compute_peak_t compute_peak; + LIBARDOUR_API extern find_peaks_t find_peaks; + LIBARDOUR_API extern apply_gain_to_buffer_t apply_gain_to_buffer; + LIBARDOUR_API extern mix_buffers_with_gain_t mix_buffers_with_gain; + LIBARDOUR_API extern mix_buffers_no_gain_t mix_buffers_no_gain; + LIBARDOUR_API extern copy_vector_t copy_vector; } #endif /* __ardour_runtime_functions_h__ */ diff --git a/libs/ardour/ardour/soundcloud_upload.h b/libs/ardour/ardour/soundcloud_upload.h index aff9245d66..bcf924738f 100644 --- a/libs/ardour/ardour/soundcloud_upload.h +++ b/libs/ardour/ardour/soundcloud_upload.h @@ -32,18 +32,18 @@ public: SoundcloudUploader(); ~SoundcloudUploader(); - std::string Get_Auth_Token(std::string username, std::string password); + std::string Get_Auth_Token(std::string username, std::string password); std::string Upload (std::string file_path, std::string title, std::string token, bool ispublic, bool downloadable, ARDOUR::ExportHandler *caller); - static int progress_callback(void *caller, double dltotal, double dlnow, double ultotal, double ulnow); + static int progress_callback(void *caller, double dltotal, double dlnow, double ultotal, double ulnow); private: - void setcUrlOptions(); + void setcUrlOptions(); CURL *curl_handle; CURLM *multi_handle; - char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message + char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message std::string title; ARDOUR::ExportHandler *caller; diff --git a/libs/ardour/ardour/soundseq.h b/libs/ardour/ardour/soundseq.h index 93faa75b9b..662e78c6a6 100644 --- a/libs/ardour/ardour/soundseq.h +++ b/libs/ardour/ardour/soundseq.h @@ -47,7 +47,7 @@ class LIBARDOUR_API SoundPlaylist : public EDL::Playlist { } /* namespace ARDOUR */ -#endif /* __soundseq_h__ */ +#endif /* __soundseq_h__ */ diff --git a/libs/ardour/ardour/transport_master.h b/libs/ardour/ardour/transport_master.h index f14da63d25..2b5ec06f1f 100644 --- a/libs/ardour/ardour/transport_master.h +++ b/libs/ardour/ardour/transport_master.h @@ -205,7 +205,7 @@ class LIBARDOUR_API TransportMaster : public PBD::Stateful { * ARDOURs transport position to the slaves requested transport position. * *
  • TransportMaster::locked() should return true, otherwise Session::no_roll will be called
  • - *
  • TransportMaster::starting() should be false, otherwise the transport will not move until it becomes true
  • * + *
  • TransportMaster::starting() should be false, otherwise the transport will not move until it becomes true
  • * * * @param speed - The transport speed requested diff --git a/libs/ardour/ardour/vestige/vestige.h b/libs/ardour/ardour/vestige/vestige.h index 41e78f7a05..5abe1c62a7 100644 --- a/libs/ardour/ardour/vestige/vestige.h +++ b/libs/ardour/ardour/vestige/vestige.h @@ -30,10 +30,10 @@ #ifndef _VESTIGE_H #define _VESTIGE_H -#define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \ - ( ( (int) b ) << 16 ) | \ - ( ( (int) c ) << 8 ) | \ - ( ( (int) d ) << 0 ) ) +#define CCONST(a, b, c, d) (( ((int) a) << 24 ) | \ + ( ((int) b) << 16 ) | \ + ( ((int) c) << 8 ) | \ + ( ((int) d) << 0 )) #define audioMasterAutomate 0 #define audioMasterVersion 1 diff --git a/libs/ardour/ardour/vumeterdsp.h b/libs/ardour/ardour/vumeterdsp.h index 1271276d68..5cc4ad5e4a 100644 --- a/libs/ardour/ardour/vumeterdsp.h +++ b/libs/ardour/ardour/vumeterdsp.h @@ -18,7 +18,7 @@ */ #ifndef __VUMETERDSP_H -#define __VUMETERDSP_H +#define __VUMETERDSP_H #include "ardour/libardour_visibility.h" @@ -46,5 +46,4 @@ private: static float _g; // gain factor }; - #endif diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 3244cb56a1..73f740d00c 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1381,8 +1381,8 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha float penalty = 9999; int used_possible_in = 0; #if defined (__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wtautological-compare" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wtautological-compare" #endif #define FOUNDCFG(nch) { \ @@ -1575,7 +1575,7 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("\tCHOSEN: in %1 out %2\n", in, out)); #if defined (__clang__) -# pragma clang diagnostic pop +# pragma clang diagnostic pop #endif return true; } @@ -3102,7 +3102,7 @@ AUPluginInfo::cached_io_configuration (const std::string& unique_id, * bus configs as incremental options. */ Boolean* isWritable = 0; - UInt32 dataSize = 0; + UInt32 dataSize = 0; OSStatus result = AudioUnitGetPropertyInfo (unit.AU(), kAudioUnitProperty_SupportedNumChannels, kAudioUnitScope_Global, 0, diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 5a59ff339b..ef974d6558 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -335,7 +335,7 @@ AudioFileSource::safe_audio_file_extension(const string& file) ".mp3", ".MP3", ".mp4", ".MP4", ".m4a", ".M4A", - ".sd2", ".SD2", // libsndfile supports sd2 also, but the resource fork is required to open. + ".sd2", ".SD2", // libsndfile supports sd2 also, but the resource fork is required to open. #endif // HAVE_COREAUDIO }; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 1f8bbafcbc..86b801e434 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -150,27 +150,27 @@ void AudioRegion::make_property_quarks () { Properties::envelope_active.property_id = g_quark_from_static_string (X_("envelope-active")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for envelope-active = %1\n", Properties::envelope_active.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for envelope-active = %1\n", Properties::envelope_active.property_id)); Properties::default_fade_in.property_id = g_quark_from_static_string (X_("default-fade-in")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for default-fade-in = %1\n", Properties::default_fade_in.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for default-fade-in = %1\n", Properties::default_fade_in.property_id)); Properties::default_fade_out.property_id = g_quark_from_static_string (X_("default-fade-out")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for default-fade-out = %1\n", Properties::default_fade_out.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for default-fade-out = %1\n", Properties::default_fade_out.property_id)); Properties::fade_in_active.property_id = g_quark_from_static_string (X_("fade-in-active")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-in-active = %1\n", Properties::fade_in_active.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-in-active = %1\n", Properties::fade_in_active.property_id)); Properties::fade_out_active.property_id = g_quark_from_static_string (X_("fade-out-active")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-out-active = %1\n", Properties::fade_out_active.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-out-active = %1\n", Properties::fade_out_active.property_id)); Properties::scale_amplitude.property_id = g_quark_from_static_string (X_("scale-amplitude")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for scale-amplitude = %1\n", Properties::scale_amplitude.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for scale-amplitude = %1\n", Properties::scale_amplitude.property_id)); Properties::fade_in.property_id = g_quark_from_static_string (X_("FadeIn")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for FadeIn = %1\n", Properties::fade_in.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for FadeIn = %1\n", Properties::fade_in.property_id)); Properties::inverse_fade_in.property_id = g_quark_from_static_string (X_("InverseFadeIn")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for InverseFadeIn = %1\n", Properties::inverse_fade_in.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for InverseFadeIn = %1\n", Properties::inverse_fade_in.property_id)); Properties::fade_out.property_id = g_quark_from_static_string (X_("FadeOut")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for FadeOut = %1\n", Properties::fade_out.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for FadeOut = %1\n", Properties::fade_out.property_id)); Properties::inverse_fade_out.property_id = g_quark_from_static_string (X_("InverseFadeOut")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for InverseFadeOut = %1\n", Properties::inverse_fade_out.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for InverseFadeOut = %1\n", Properties::inverse_fade_out.property_id)); Properties::envelope.property_id = g_quark_from_static_string (X_("Envelope")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for Envelope = %1\n", Properties::envelope.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for Envelope = %1\n", Properties::envelope.property_id)); } void @@ -261,8 +261,8 @@ AudioRegion::AudioRegion (boost::shared_ptr other) : Region (other) , AUDIOREGION_COPY_STATE (other) /* As far as I can see, the _envelope's times are relative to region position, and have nothing - to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset. - */ + * to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset. + */ , _envelope (Properties::envelope, boost::shared_ptr (new AutomationList (*other->_envelope.val(), 0, other->_length))) , _automatable (other->session()) , _fade_in_suspended (0) @@ -1195,7 +1195,7 @@ AudioRegion::set_fade_out_length (samplecnt_t len) len = 64; } - bool changed = _fade_out->extend_to (len); + bool changed = _fade_out->extend_to (len); if (changed) { diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index d1c1728b37..424662d5e2 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -375,7 +375,7 @@ ExportHandler::finish_timespan () if (!fmt->command().empty()) { SessionMetadata const & metadata (*SessionMetadata::Metadata()); -#if 0 // would be nicer with C++11 initialiser... +#if 0 // would be nicer with C++11 initialiser... std::map subs { { 'f', filename }, { 'd', Glib::path_get_dirname(filename) + G_DIR_SEPARATOR }, diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc index 877b434377..a9fa6780a1 100644 --- a/libs/ardour/export_profile_manager.cc +++ b/libs/ardour/export_profile_manager.cc @@ -158,7 +158,6 @@ ExportProfileManager::prepare_for_export () ++format_it, ++filename_it) { ExportFilenamePtr filename = (*filename_it)->filename; -// filename->include_timespan = (ts_list->size() > 1); Disabled for now... boost::shared_ptr b; if ((*format_it)->format->has_broadcast_info()) { @@ -943,8 +942,6 @@ ExportProfileManager::check_config (boost::shared_ptr warnings, /* Check filenames */ -// filename->include_timespan = (timespans->size() > 1); Disabled for now... - std::list paths; build_filenames(paths, filename, timespans, channel_config, format); diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 07e48aca5c..e42c0d5ca9 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -140,7 +140,7 @@ find_peaks_t ARDOUR::find_peaks = 0; apply_gain_to_buffer_t ARDOUR::apply_gain_to_buffer = 0; mix_buffers_with_gain_t ARDOUR::mix_buffers_with_gain = 0; mix_buffers_no_gain_t ARDOUR::mix_buffers_no_gain = 0; -copy_vector_t ARDOUR::copy_vector = 0; +copy_vector_t ARDOUR::copy_vector = 0; PBD::Signal1 ARDOUR::BootMessage; PBD::Signal3 ARDOUR::PluginScanMessage; diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 693dc07f23..c6624b2e4a 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1384,8 +1384,6 @@ IO::enable_connecting () void IO::bundle_changed (Bundle::Change /*c*/) { - /* XXX */ -// connect_input_ports_to_bundle (_input_bundle, this); } diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc index 4f26af997d..85381cb2d1 100644 --- a/libs/ardour/parameter_descriptor.cc +++ b/libs/ardour/parameter_descriptor.cc @@ -294,7 +294,7 @@ ParameterDescriptor::midi_note_num (const std::string& name) { static NameNumMap name2num = build_midi_name2num(); - uint8_t num = -1; // -1 (or 255) is returned in case of failure + uint8_t num = -1; // -1 (or 255) is returned in case of failure NameNumMap::const_iterator it = name2num.find(normalize_note_name(name)); if (it != name2num.end()) diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index 6e57f17220..b021084196 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -637,7 +637,7 @@ PluginManager::ladspa_discover (string path) { DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Checking for LADSPA plugin at %1\n", path)); - Glib::Module module(path); + Glib::Module module (path); const LADSPA_Descriptor *descriptor; LADSPA_Descriptor_Function dfunc; void* func = 0; @@ -739,9 +739,6 @@ PluginManager::ladspa_discover (string path) DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Found LADSPA plugin, name: %1, Inputs: %2, Outputs: %3\n", info->name, info->n_inputs, info->n_outputs)); } -// GDB WILL NOT LIKE YOU IF YOU DO THIS -// dlclose (module); - return 0; } diff --git a/libs/ardour/presentation_info.cc b/libs/ardour/presentation_info.cc index 1e0c99fc60..261d54bf5c 100644 --- a/libs/ardour/presentation_info.cc +++ b/libs/ardour/presentation_info.cc @@ -123,12 +123,12 @@ const PresentationInfo::Flag PresentationInfo::MixerStripables = PresentationInf void PresentationInfo::make_property_quarks () { - Properties::selected.property_id = g_quark_from_static_string (X_("selected")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for selected = %1\n", Properties::selected.property_id)); - Properties::color.property_id = g_quark_from_static_string (X_("color")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for color = %1\n", Properties::color.property_id)); - Properties::order.property_id = g_quark_from_static_string (X_("order")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for order = %1\n", Properties::order.property_id)); + Properties::selected.property_id = g_quark_from_static_string (X_("selected")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for selected = %1\n", Properties::selected.property_id)); + Properties::color.property_id = g_quark_from_static_string (X_("color")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for color = %1\n", Properties::color.property_id)); + Properties::order.property_id = g_quark_from_static_string (X_("order")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for order = %1\n", Properties::order.property_id)); } PresentationInfo::PresentationInfo (Flag f) diff --git a/libs/ardour/rc_configuration.cc b/libs/ardour/rc_configuration.cc index 3227a644dd..6510bbf697 100644 --- a/libs/ardour/rc_configuration.cc +++ b/libs/ardour/rc_configuration.cc @@ -257,13 +257,14 @@ RCConfiguration::set_variables (const XMLNode& node) #undef CONFIG_VARIABLE #undef CONFIG_VARIABLE_SPECIAL #define CONFIG_VARIABLE(type,var,name,value) \ - if (var.set_from_node (node)) { \ - ParameterChanged (name); \ - } + if (var.set_from_node (node)) { \ + ParameterChanged (name); \ + } + #define CONFIG_VARIABLE_SPECIAL(type,var,name,value,mutator) \ - if (var.set_from_node (node)) { \ - ParameterChanged (name); \ - } + if (var.set_from_node (node)) { \ + ParameterChanged (name); \ + } #include "ardour/rc_configuration_vars.h" #undef CONFIG_VARIABLE diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 13dcdff326..16c84824f1 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -84,57 +84,57 @@ void Region::make_property_quarks () { Properties::muted.property_id = g_quark_from_static_string (X_("muted")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for muted = %1\n", Properties::muted.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for muted = %1\n", Properties::muted.property_id)); Properties::opaque.property_id = g_quark_from_static_string (X_("opaque")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for opaque = %1\n", Properties::opaque.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for opaque = %1\n", Properties::opaque.property_id)); Properties::locked.property_id = g_quark_from_static_string (X_("locked")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for locked = %1\n", Properties::locked.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for locked = %1\n", Properties::locked.property_id)); Properties::video_locked.property_id = g_quark_from_static_string (X_("video-locked")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for video-locked = %1\n", Properties::video_locked.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for video-locked = %1\n", Properties::video_locked.property_id)); Properties::automatic.property_id = g_quark_from_static_string (X_("automatic")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for automatic = %1\n", Properties::automatic.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for automatic = %1\n", Properties::automatic.property_id)); Properties::whole_file.property_id = g_quark_from_static_string (X_("whole-file")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for whole-file = %1\n", Properties::whole_file.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for whole-file = %1\n", Properties::whole_file.property_id)); Properties::import.property_id = g_quark_from_static_string (X_("import")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for import = %1\n", Properties::import.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for import = %1\n", Properties::import.property_id)); Properties::external.property_id = g_quark_from_static_string (X_("external")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for external = %1\n", Properties::external.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for external = %1\n", Properties::external.property_id)); Properties::sync_marked.property_id = g_quark_from_static_string (X_("sync-marked")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for sync-marked = %1\n", Properties::sync_marked.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for sync-marked = %1\n", Properties::sync_marked.property_id)); Properties::left_of_split.property_id = g_quark_from_static_string (X_("left-of-split")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for left-of-split = %1\n", Properties::left_of_split.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for left-of-split = %1\n", Properties::left_of_split.property_id)); Properties::right_of_split.property_id = g_quark_from_static_string (X_("right-of-split")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for right-of-split = %1\n", Properties::right_of_split.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for right-of-split = %1\n", Properties::right_of_split.property_id)); Properties::hidden.property_id = g_quark_from_static_string (X_("hidden")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for hidden = %1\n", Properties::hidden.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for hidden = %1\n", Properties::hidden.property_id)); Properties::position_locked.property_id = g_quark_from_static_string (X_("position-locked")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position-locked = %1\n", Properties::position_locked.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position-locked = %1\n", Properties::position_locked.property_id)); Properties::valid_transients.property_id = g_quark_from_static_string (X_("valid-transients")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for valid-transients = %1\n", Properties::valid_transients.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for valid-transients = %1\n", Properties::valid_transients.property_id)); Properties::start.property_id = g_quark_from_static_string (X_("start")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for start = %1\n", Properties::start.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for start = %1\n", Properties::start.property_id)); Properties::length.property_id = g_quark_from_static_string (X_("length")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for length = %1\n", Properties::length.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for length = %1\n", Properties::length.property_id)); Properties::position.property_id = g_quark_from_static_string (X_("position")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position = %1\n", Properties::position.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position = %1\n", Properties::position.property_id)); Properties::beat.property_id = g_quark_from_static_string (X_("beat")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for beat = %1\n", Properties::beat.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for beat = %1\n", Properties::beat.property_id)); Properties::sync_position.property_id = g_quark_from_static_string (X_("sync-position")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for sync-position = %1\n", Properties::sync_position.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for sync-position = %1\n", Properties::sync_position.property_id)); Properties::layer.property_id = g_quark_from_static_string (X_("layer")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for layer = %1\n", Properties::layer.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for layer = %1\n", Properties::layer.property_id)); Properties::ancestral_start.property_id = g_quark_from_static_string (X_("ancestral-start")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for ancestral-start = %1\n", Properties::ancestral_start.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for ancestral-start = %1\n", Properties::ancestral_start.property_id)); Properties::ancestral_length.property_id = g_quark_from_static_string (X_("ancestral-length")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for ancestral-length = %1\n", Properties::ancestral_length.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for ancestral-length = %1\n", Properties::ancestral_length.property_id)); Properties::stretch.property_id = g_quark_from_static_string (X_("stretch")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for stretch = %1\n", Properties::stretch.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for stretch = %1\n", Properties::stretch.property_id)); Properties::shift.property_id = g_quark_from_static_string (X_("shift")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for shift = %1\n", Properties::shift.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for shift = %1\n", Properties::shift.property_id)); Properties::position_lock_style.property_id = g_quark_from_static_string (X_("positional-lock-style")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position_lock_style = %1\n", Properties::position_lock_style.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for position_lock_style = %1\n", Properties::position_lock_style.property_id)); Properties::layering_index.property_id = g_quark_from_static_string (X_("layering-index")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for layering_index = %1\n", Properties::layering_index.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for layering_index = %1\n", Properties::layering_index.property_id)); } void @@ -174,8 +174,8 @@ Region::register_properties () , _left_of_split (Properties::left_of_split, false) \ , _right_of_split (Properties::right_of_split, false) \ , _valid_transients (Properties::valid_transients, false) \ - , _start (Properties::start, (s)) \ - , _length (Properties::length, (l)) \ + , _start (Properties::start, (s)) \ + , _length (Properties::length, (l)) \ , _position (Properties::position, 0) \ , _beat (Properties::beat, 0.0) \ , _sync_position (Properties::sync_position, (s)) \ @@ -206,32 +206,32 @@ Region::register_properties () , _left_of_split (Properties::left_of_split, other->_left_of_split) \ , _right_of_split (Properties::right_of_split, other->_right_of_split) \ , _valid_transients (Properties::valid_transients, other->_valid_transients) \ - , _start(Properties::start, other->_start) \ - , _length(Properties::length, other->_length) \ - , _position(Properties::position, other->_position) \ - , _beat (Properties::beat, other->_beat) \ + , _start(Properties::start, other->_start) \ + , _length(Properties::length, other->_length) \ + , _position(Properties::position, other->_position) \ + , _beat (Properties::beat, other->_beat) \ , _sync_position(Properties::sync_position, other->_sync_position) \ - , _quarter_note (other->_quarter_note) \ + , _quarter_note (other->_quarter_note) \ , _user_transients (other->_user_transients) \ , _transient_user_start (other->_transient_user_start) \ , _transients (other->_transients) \ , _transient_analysis_start (other->_transient_analysis_start) \ , _transient_analysis_end (other->_transient_analysis_end) \ , _soloSelected (false) \ - , _muted (Properties::muted, other->_muted) \ - , _opaque (Properties::opaque, other->_opaque) \ - , _locked (Properties::locked, other->_locked) \ + , _muted (Properties::muted, other->_muted) \ + , _opaque (Properties::opaque, other->_opaque) \ + , _locked (Properties::locked, other->_locked) \ , _video_locked (Properties::video_locked, other->_video_locked) \ - , _automatic (Properties::automatic, other->_automatic) \ + , _automatic (Properties::automatic, other->_automatic) \ , _whole_file (Properties::whole_file, other->_whole_file) \ - , _import (Properties::import, other->_import) \ - , _external (Properties::external, other->_external) \ - , _hidden (Properties::hidden, other->_hidden) \ + , _import (Properties::import, other->_import) \ + , _external (Properties::external, other->_external) \ + , _hidden (Properties::hidden, other->_hidden) \ , _position_locked (Properties::position_locked, other->_position_locked) \ , _ancestral_start (Properties::ancestral_start, other->_ancestral_start) \ , _ancestral_length (Properties::ancestral_length, other->_ancestral_length) \ - , _stretch (Properties::stretch, other->_stretch) \ - , _shift (Properties::shift, other->_shift) \ + , _stretch (Properties::stretch, other->_stretch) \ + , _shift (Properties::shift, other->_shift) \ , _position_lock_style (Properties::position_lock_style, other->_position_lock_style) \ , _layering_index (Properties::layering_index, other->_layering_index) @@ -301,15 +301,15 @@ Region::Region (boost::shared_ptr other) _quarter_note = other->_quarter_note; /* sync pos is relative to start of file. our start-in-file is now zero, - so set our sync position to whatever the the difference between - _start and _sync_pos was in the other region. - - result is that our new sync pos points to the same point in our source(s) - as the sync in the other region did in its source(s). - - since we start at zero in our source(s), it is not possible to use a sync point that - is before the start. reset it to _start if that was true in the other region. - */ + * so set our sync position to whatever the the difference between + * _start and _sync_pos was in the other region. + * + * result is that our new sync pos points to the same point in our source(s) + * as the sync in the other region did in its source(s). + * + * since we start at zero in our source(s), it is not possible to use a sync point that + * is before the start. reset it to _start if that was true in the other region. + */ if (other->sync_marked()) { if (other->_start < other->_sync_position) { @@ -329,10 +329,10 @@ Region::Region (boost::shared_ptr other) } /** Create a new Region from part of an existing one. - - the start within \a other is given by \a offset - (i.e. relative to the start of \a other's sources, the start is \a offset + \a other.start() -*/ + * + * the start within \a other is given by \a offset + * (i.e. relative to the start of \a other's sources, the start is \a offset + \a other.start() + */ Region::Region (boost::shared_ptr other, MusicSample offset) : SessionObject(other->session(), other->name()) , _type (other->data_type()) @@ -369,9 +369,9 @@ Region::Region (boost::shared_ptr other, MusicSample offset) } /* if the other region had a distinct sync point - set, then continue to use it as best we can. - otherwise, reset sync point back to start. - */ + * set, then continue to use it as best we can. + * otherwise, reset sync point back to start. + */ if (other->sync_marked()) { if (other->_sync_position < _start) { @@ -418,7 +418,7 @@ Region::Region (boost::shared_ptr other, const SourceList& srcs) Region::~Region () { DEBUG_TRACE (DEBUG::Destruction, string_compose ("Region %1 destructor @ %2\n", _name, this)); - drop_sources (); + drop_sources (); } void @@ -470,8 +470,8 @@ Region::set_length (samplecnt_t len, const int32_t sub_num) if (_length != len && len != 0) { /* check that the current _position wouldn't make the new - length impossible. - */ + * length impossible. + */ if (max_samplepos - len < _position) { return; @@ -565,8 +565,8 @@ void Region::special_set_position (samplepos_t pos) { /* this is used when creating a whole file region as - a way to store its "natural" or "captured" position. - */ + * a way to store its "natural" or "captured" position. + */ _position = _position; _position = pos; @@ -606,8 +606,8 @@ Region::update_after_tempo_map_change (bool send) set_position_internal (pos, false, 0); /* do this even if the position is the same. this helps out - a GUI that has moved its representation already. - */ + * a GUI that has moved its representation already. + */ if (send) { send_change (Properties::position); @@ -622,8 +622,8 @@ Region::set_position (samplepos_t pos, int32_t sub_num) } /* do this even if the position is the same. this helps out - a GUI that has moved its representation already. - */ + * a GUI that has moved its representation already. + */ PropertyChange p_and_l; p_and_l.add (Properties::position); @@ -651,9 +651,9 @@ void Region::set_position_internal (samplepos_t pos, bool allow_bbt_recompute, const int32_t sub_num) { /* We emit a change of Properties::position even if the position hasn't changed - (see Region::set_position), so we must always set this up so that - e.g. Playlist::notify_region_moved doesn't use an out-of-date last_position. - */ + * (see Region::set_position), so we must always set this up so that + * e.g. Playlist::notify_region_moved doesn't use an out-of-date last_position. + */ _last_position = _position; if (_position != pos) { @@ -667,10 +667,10 @@ Region::set_position_internal (samplepos_t pos, bool allow_bbt_recompute, const } /* check that the new _position wouldn't make the current - length impossible - if so, change the length. - - XXX is this the right thing to do? - */ + * length impossible - if so, change the length. + * + * XXX is this the right thing to do? + */ if (max_samplepos - _length < _position) { _last_length = _length; _length = max_samplepos - _position; @@ -686,8 +686,8 @@ Region::set_position_music (double qn) } /* do this even if the position is the same. this helps out - a GUI that has moved its representation already. - */ + * a GUI that has moved its representation already. + */ PropertyChange p_and_l; p_and_l.add (Properties::position); @@ -710,9 +710,9 @@ void Region::set_position_music_internal (double qn) { /* We emit a change of Properties::position even if the position hasn't changed - (see Region::set_position), so we must always set this up so that - e.g. Playlist::notify_region_moved doesn't use an out-of-date last_position. - */ + * (see Region::set_position), so we must always set this up so that + * e.g. Playlist::notify_region_moved doesn't use an out-of-date last_position. + */ _last_position = _position; if (_quarter_note != qn) { @@ -720,10 +720,10 @@ Region::set_position_music_internal (double qn) _quarter_note = qn; /* check that the new _position wouldn't make the current - length impossible - if so, change the length. - - XXX is this the right thing to do? - */ + * length impossible - if so, change the length. + * + * XXX is this the right thing to do? + */ if (max_samplepos - _length < _position) { _last_length = _length; _length = max_samplepos - _position; @@ -732,9 +732,9 @@ Region::set_position_music_internal (double qn) } /** A gui may need to create a region, then place it in an initial - * position determined by the user. - * When this takes place within one gui operation, we have to reset - * _last_position to prevent an implied move. + * position determined by the user. + * When this takes place within one gui operation, we have to reset + * _last_position to prevent an implied move. */ void Region::set_initial_position (samplepos_t pos) @@ -747,10 +747,10 @@ Region::set_initial_position (samplepos_t pos) _position = pos; /* check that the new _position wouldn't make the current - length impossible - if so, change the length. - - XXX is this the right thing to do? - */ + * length impossible - if so, change the length. + * + * XXX is this the right thing to do? + */ if (max_samplepos - _length < _position) { _last_length = _length; @@ -764,8 +764,8 @@ Region::set_initial_position (samplepos_t pos) /* do this even if the position is the same. this helps out - a GUI that has moved its representation already. - */ + * a GUI that has moved its representation already. + */ send_change (Properties::position); } @@ -824,9 +824,9 @@ Region::set_start (samplepos_t pos) return; } /* This just sets the start, nothing else. It effectively shifts - the contents of the Region within the overall extent of the Source, - without changing the Region's position or length - */ + * the contents of the Region within the overall extent of the Source, + * without changing the Region's position or length + */ if (_start != pos) { @@ -970,9 +970,8 @@ Region::modify_end (samplepos_t new_endpoint, bool reset_fade, const int32_t sub } /** @param new_endpoint New region end point, such that, for example, - * a region at 0 of length 10 has an endpoint of 9. + * a region at 0 of length 10 has an endpoint of 9. */ - void Region::trim_end (samplepos_t new_endpoint, const int32_t sub_num) { diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index 7b24a88114..23733d9705 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -63,28 +63,28 @@ void RouteGroup::make_property_quarks () { Properties::active.property_id = g_quark_from_static_string (X_("active")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for active = %1\n", Properties::active.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for active = %1\n", Properties::active.property_id)); - Properties::group_relative.property_id = g_quark_from_static_string (X_("relative")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for relative = %1\n", Properties::group_relative.property_id)); + Properties::group_relative.property_id = g_quark_from_static_string (X_("relative")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for relative = %1\n", Properties::group_relative.property_id)); Properties::group_gain.property_id = g_quark_from_static_string (X_("gain")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for gain = %1\n", Properties::group_gain.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for gain = %1\n", Properties::group_gain.property_id)); Properties::group_mute.property_id = g_quark_from_static_string (X_("mute")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for mute = %1\n", Properties::group_mute.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for mute = %1\n", Properties::group_mute.property_id)); Properties::group_solo.property_id = g_quark_from_static_string (X_("solo")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for solo = %1\n", Properties::group_solo.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for solo = %1\n", Properties::group_solo.property_id)); Properties::group_recenable.property_id = g_quark_from_static_string (X_("recenable")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for recenable = %1\n", Properties::group_recenable.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for recenable = %1\n", Properties::group_recenable.property_id)); Properties::group_select.property_id = g_quark_from_static_string (X_("select")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for select = %1\n", Properties::group_select.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for select = %1\n", Properties::group_select.property_id)); Properties::group_route_active.property_id = g_quark_from_static_string (X_("route-active")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for route-active = %1\n", Properties::group_route_active.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for route-active = %1\n", Properties::group_route_active.property_id)); Properties::group_color.property_id = g_quark_from_static_string (X_("color")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for color = %1\n", Properties::group_color.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for color = %1\n", Properties::group_color.property_id)); Properties::group_monitoring.property_id = g_quark_from_static_string (X_("monitoring")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for monitoring = %1\n", Properties::group_monitoring.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for monitoring = %1\n", Properties::group_monitoring.property_id)); Properties::group_master_number.property_id = g_quark_from_static_string (X_("group-master-number")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for group-master-number = %1\n", Properties::group_master_number.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for group-master-number = %1\n", Properties::group_master_number.property_id)); } #define ROUTE_GROUP_DEFAULT_PROPERTIES _relative (Properties::group_relative, true) \ diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 750ef3b23e..fce6b22912 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1042,7 +1042,7 @@ Session::setup_bundles () if (np + 1 < outputs[DataType::AUDIO].size()) { char buf[32]; snprintf (buf, sizeof(buf), _("out %" PRIu32 "+%" PRIu32), np + 1, np + 2); - boost::shared_ptr c (new Bundle (buf, true)); + boost::shared_ptr c (new Bundle (buf, true)); c->add_channel (_("L"), DataType::AUDIO); c->set_port (0, outputs[DataType::AUDIO][np]); c->add_channel (_("R"), DataType::AUDIO); @@ -1616,11 +1616,6 @@ Session::track_playlist_changed (boost::weak_ptr wp) bool Session::record_enabling_legal () const { - /* this used to be in here, but survey says.... we don't need to restrict it */ - // if (record_status() == Recording) { - // return false; - // } - if (Config->get_all_safe()) { return false; } @@ -1841,10 +1836,10 @@ Session::update_skips (Location* loc, bool consolidate) Locations::LocationList skips; - if (consolidate) { - PBD::Unwinder uw (_ignore_skips_updates, true); - consolidate_skips (loc); - } + if (consolidate) { + PBD::Unwinder uw (_ignore_skips_updates, true); + consolidate_skips (loc); + } sync_locations_to_skips (); @@ -1854,41 +1849,41 @@ Session::update_skips (Location* loc, bool consolidate) void Session::consolidate_skips (Location* loc) { - Locations::LocationList all_locations = _locations->list (); + Locations::LocationList all_locations = _locations->list (); - for (Locations::LocationList::iterator l = all_locations.begin(); l != all_locations.end(); ) { + for (Locations::LocationList::iterator l = all_locations.begin(); l != all_locations.end(); ) { - if (!(*l)->is_skip ()) { - ++l; - continue; - } + if (!(*l)->is_skip ()) { + ++l; + continue; + } - /* don't test against self */ + /* don't test against self */ - if (*l == loc) { - ++l; - continue; - } + if (*l == loc) { + ++l; + continue; + } - switch (Evoral::coverage ((*l)->start(), (*l)->end(), loc->start(), loc->end())) { - case Evoral::OverlapInternal: - case Evoral::OverlapExternal: - case Evoral::OverlapStart: - case Evoral::OverlapEnd: - /* adjust new location to cover existing one */ - loc->set_start (min (loc->start(), (*l)->start())); - loc->set_end (max (loc->end(), (*l)->end())); - /* we don't need this one any more */ - _locations->remove (*l); - /* the location has been deleted, so remove reference to it in our local list */ - l = all_locations.erase (l); - break; + switch (Evoral::coverage ((*l)->start(), (*l)->end(), loc->start(), loc->end())) { + case Evoral::OverlapInternal: + case Evoral::OverlapExternal: + case Evoral::OverlapStart: + case Evoral::OverlapEnd: + /* adjust new location to cover existing one */ + loc->set_start (min (loc->start(), (*l)->start())); + loc->set_end (max (loc->end(), (*l)->end())); + /* we don't need this one any more */ + _locations->remove (*l); + /* the location has been deleted, so remove reference to it in our local list */ + l = all_locations.erase (l); + break; - case Evoral::OverlapNone: - ++l; - break; - } - } + case Evoral::OverlapNone: + ++l; + break; + } + } } void @@ -1922,52 +1917,52 @@ Session::_sync_locations_to_skips () void Session::location_added (Location *location) { - if (location->is_auto_punch()) { - set_auto_punch_location (location); - } + if (location->is_auto_punch()) { + set_auto_punch_location (location); + } - if (location->is_auto_loop()) { - set_auto_loop_location (location); - } + if (location->is_auto_loop()) { + set_auto_loop_location (location); + } - if (location->is_session_range()) { - /* no need for any signal handling or event setting with the session range, - because we keep a direct reference to it and use its start/end directly. - */ - _session_range_location = location; - } + if (location->is_session_range()) { + /* no need for any signal handling or event setting with the session range, + because we keep a direct reference to it and use its start/end directly. + */ + _session_range_location = location; + } - if (location->is_mark()) { - /* listen for per-location signals that require us to do any * global updates for marks */ + if (location->is_mark()) { + /* listen for per-location signals that require us to do any * global updates for marks */ - location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); location->PositionLockStyleChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - } + } if (location->is_range_marker()) { - /* listen for per-location signals that require us to do any * global updates for marks */ + /* listen for per-location signals that require us to do any * global updates for marks */ - location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); + location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); location->PositionLockStyleChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - } + } - if (location->is_skip()) { - /* listen for per-location signals that require us to update skip-locate events */ + if (location->is_skip()) { + /* listen for per-location signals that require us to update skip-locate events */ - location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true)); - location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true)); - location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true)); - location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, false)); + location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true)); + location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true)); + location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, true)); + location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_skips, this, location, false)); location->PositionLockStyleChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location)); - update_skips (location, true); - } + update_skips (location, true); + } set_dirty (); } @@ -2003,17 +1998,17 @@ Session::location_removed (Location *location) void Session::locations_changed () { - _locations->apply (*this, &Session::_locations_changed); + _locations->apply (*this, &Session::_locations_changed); } void Session::_locations_changed (const Locations::LocationList& locations) { - /* There was some mass-change in the Locations object. - - 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. - */ + /* There was some mass-change in the Locations object. + * + * 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); @@ -2622,7 +2617,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, bool s --how_many; } - failed: + failed: if (!new_routes.empty()) { StateProtector sp (this); if (Profile->get_trx()) { @@ -2726,7 +2721,7 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name --how_many; } - failure: + failure: if (!ret.empty()) { StateProtector sp (this); add_routes (ret, false, false, false, order); @@ -2958,43 +2953,43 @@ Session::reconnect_existing_routes (bool withLock, bool reconnect_master, bool r void Session::reconnect_midi_scene_ports(bool inputs) { - if (inputs ) { + if (inputs ) { - boost::shared_ptr scene_in_ptr = scene_in(); - if (scene_in_ptr) { - scene_in_ptr->disconnect_all (); + boost::shared_ptr scene_in_ptr = scene_in(); + if (scene_in_ptr) { + scene_in_ptr->disconnect_all (); - std::vector midi_port_states; - EngineStateController::instance()->get_physical_midi_input_states (midi_port_states); + std::vector midi_port_states; + EngineStateController::instance()->get_physical_midi_input_states (midi_port_states); - std::vector::iterator state_iter = midi_port_states.begin(); + std::vector::iterator state_iter = midi_port_states.begin(); - for (; state_iter != midi_port_states.end(); ++state_iter) { - if (state_iter->active && state_iter->available && state_iter->scene_connected) { - scene_in_ptr->connect (state_iter->name); - } - } - } + for (; state_iter != midi_port_states.end(); ++state_iter) { + if (state_iter->active && state_iter->available && state_iter->scene_connected) { + scene_in_ptr->connect (state_iter->name); + } + } + } - } else { + } else { - boost::shared_ptr scene_out_ptr = scene_out(); + boost::shared_ptr scene_out_ptr = scene_out(); - if (scene_out_ptr ) { - scene_out_ptr->disconnect_all (); + if (scene_out_ptr ) { + scene_out_ptr->disconnect_all (); - std::vector midi_port_states; - EngineStateController::instance()->get_physical_midi_output_states (midi_port_states); + std::vector midi_port_states; + EngineStateController::instance()->get_physical_midi_output_states (midi_port_states); - std::vector::iterator state_iter = midi_port_states.begin(); + std::vector::iterator state_iter = midi_port_states.begin(); - for (; state_iter != midi_port_states.end(); ++state_iter) { - if (state_iter->active && state_iter->available && state_iter->scene_connected) { - scene_out_ptr->connect (state_iter->name); - } - } - } - } + for (; state_iter != midi_port_states.end(); ++state_iter) { + if (state_iter->active && state_iter->available && state_iter->scene_connected) { + scene_out_ptr->connect (state_iter->name); + } + } + } + } } void @@ -3187,7 +3182,7 @@ Session::new_audio_track (int input_channels, int output_channels, RouteGroup* r --how_many; } - failed: + failed: if (!new_routes.empty()) { StateProtector sp (this); if (Profile->get_trx()) { @@ -3274,7 +3269,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r --how_many; } - failure: + failure: if (!ret.empty()) { StateProtector sp (this); if (Profile->get_trx()) { @@ -3516,7 +3511,7 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i --how_many; } - out: + out: if (!ret.empty()) { StateProtector sp (this); if (Profile->get_trx()) { @@ -6306,7 +6301,7 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end, } - out: + out: if (!result) { for (vector >::iterator src = srcs.begin(); src != srcs.end(); ++src) { (*src)->mark_for_remove (); @@ -6458,7 +6453,7 @@ Session::have_rec_enabled_track () const bool Session::have_rec_disabled_track () const { - return g_atomic_int_get (const_cast(&_have_rec_disabled_track)) == 1; + return g_atomic_int_get (const_cast(&_have_rec_disabled_track)) == 1; } /** Update the state of our rec-enabled tracks flag */ diff --git a/libs/ardour/session_configuration.cc b/libs/ardour/session_configuration.cc index 8b649e2f9e..e428f1c6e0 100644 --- a/libs/ardour/session_configuration.cc +++ b/libs/ardour/session_configuration.cc @@ -105,13 +105,14 @@ SessionConfiguration::set_variables (const XMLNode& node) #undef CONFIG_VARIABLE #undef CONFIG_VARIABLE_SPECIAL #define CONFIG_VARIABLE(type,var,name,value) \ - if (var.set_from_node (node)) { \ - ParameterChanged (name); \ - } + if (var.set_from_node (node)) { \ + ParameterChanged (name); \ + } + #define CONFIG_VARIABLE_SPECIAL(type,var,name,value,mutator) \ - if (var.set_from_node (node)) { \ - ParameterChanged (name); \ - } + if (var.set_from_node (node)) { \ + ParameterChanged (name); \ + } #include "ardour/session_configuration_vars.h" #undef CONFIG_VARIABLE diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc index fd90959ac4..f84ecff478 100644 --- a/libs/ardour/session_directory.cc +++ b/libs/ardour/session_directory.cc @@ -134,9 +134,9 @@ SessionDirectory::sources_root () const * SessionDirectory is also used directly by the AudioRegionImporter, * and the peak-file background thread (session.cc). * - * There is no actual benefit to use the session-name instead of - * the folder-name. Under normal circumstances they are always - * identical. But it would be consistent to prefer the name. + * There is no actual benefit to use the session-name instead of + * the folder-name. Under normal circumstances they are always + * identical. But it would be consistent to prefer the name. */ try { Glib::Dir dir(sources_root_path); diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index 93981a9d68..d47073d97a 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -554,7 +554,7 @@ Session::send_midi_time_code_for_cycle (samplepos_t start_sample, samplepos_t en break; } - const samplepos_t msg_time = rint(outbound_mtc_timecode_frame + (quarter_frame_duration * next_quarter_frame_to_send)); + const samplepos_t msg_time = rint (outbound_mtc_timecode_frame + (quarter_frame_duration * next_quarter_frame_to_send)); // This message must fall within this block or something is broken assert (msg_time >= start_sample); @@ -642,10 +642,9 @@ Session::mmc_step_timeout () return true; } -/*********************************************************************** - OUTBOUND SYSTEM COMMON STUFF -**********************************************************************/ - +/* ********************************************************************* + * OUTBOUND SYSTEM COMMON STUFF + **********************************************************************/ void Session::send_song_position_pointer (samplepos_t) diff --git a/libs/ardour/session_object.cc b/libs/ardour/session_object.cc index 683d174b16..d105fbc86d 100644 --- a/libs/ardour/session_object.cc +++ b/libs/ardour/session_object.cc @@ -38,6 +38,6 @@ void SessionObject::make_property_quarks () { Properties::name.property_id = g_quark_from_static_string (X_("name")); - DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for name = %1\n", Properties::name.property_id)); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for name = %1\n", Properties::name.property_id)); } diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index ce2d311d39..6c08a87eca 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -704,15 +704,15 @@ MeterSection::get_state() const */ struct MetricSectionSorter { - bool operator() (const MetricSection* a, const MetricSection* b) { - return a->pulse() < b->pulse(); - } + bool operator() (const MetricSection* a, const MetricSection* b) { + return a->pulse() < b->pulse(); + } }; struct MetricSectionFrameSorter { - bool operator() (const MetricSection* a, const MetricSection* b) { - return a->sample() < b->sample(); - } + bool operator() (const MetricSection* a, const MetricSection* b) { + return a->sample() < b->sample(); + } }; TempoMap::TempoMap (samplecnt_t fr) @@ -1426,10 +1426,10 @@ TempoMap::recompute_tempi (Metrics& metrics) } /* tempos must be positioned correctly. - the current approach is to use a meter's bbt time as its base position unit. - an audio-locked meter requires a recomputation of pulse and beat (but not bbt), - while a music-locked meter requires recomputations of sample pulse and beat (but not bbt) -*/ + * the current approach is to use a meter's bbt time as its base position unit. + * an audio-locked meter requires a recomputation of pulse and beat (but not bbt), + * while a music-locked meter requires recomputations of sample pulse and beat (but not bbt) + */ void TempoMap::recompute_meters (Metrics& metrics) { @@ -3382,9 +3382,10 @@ TempoMap::gui_stretch_tempo (TempoSection* ts, const samplepos_t sample, const s if (ts_copy->clamped()) { TempoSection* next_t = next_tempo_section_locked (future_map, ts_copy); TempoSection* prev_to_ts_copy = previous_tempo_section_locked (future_map, ts_copy); - /* the change in samples is the result of changing the slope of at most 2 previous tempo sections. - constant to constant is straightforward, as the tempo prev to ts_copy has constant slope. - */ double contribution = 0.0; + /* the change in samples is the result of changing the slope of at most 2 previous tempo sections. + * constant to constant is straightforward, as the tempo prev to ts_copy has constant slope. + */ + double contribution = 0.0; if (next_t && prev_to_ts_copy && prev_to_ts_copy->type() == TempoSection::Ramp) { contribution = (ts_copy->pulse() - prev_to_ts_copy->pulse()) / (double) (next_t->pulse() - prev_to_ts_copy->pulse()); } @@ -3951,13 +3952,16 @@ TempoMap::round_to_quarter_note_subdivision (samplepos_t fr, int sub_num, RoundM ticks += ticks_one_subdivisions_worth - mod; } -//NOTE: this code intentionally limits the rounding so we don't advance to the next beat. -// For the purposes of "jump-to-next-subdivision", we DO want to advance to the next beat. -// And since the "prev" direction DOES move beats, I assume this code is unintended. -// But I'm keeping it around, until we determine there are no terrible consequences. -// if (ticks >= BBT_Time::ticks_per_beat) { -// ticks -= BBT_Time::ticks_per_beat; -// } + /* NOTE: this code intentionally limits the rounding so we don't advance to the next beat. + * For the purposes of "jump-to-next-subdivision", we DO want to advance to the next beat. + * And since the "prev" direction DOES move beats, I assume this code is unintended. + * But I'm keeping it around, commened out, until we determine there are no terrible consequences. + */ +#if 0 + if (ticks >= BBT_Time::ticks_per_beat) { + ticks -= BBT_Time::ticks_per_beat; + } +#endif } else if (dir < 0) { @@ -4337,8 +4341,8 @@ TempoMap::next_tempo_section_locked (const Metrics& metrics, TempoSection* ts) c return 0; } /* don't use this to calculate length (the tempo is only correct for this sample). - do that stuff based on the beat_at_sample and sample_at_beat api -*/ + * do that stuff based on the beat_at_sample and sample_at_beat api + */ double TempoMap::samples_per_quarter_note_at (const samplepos_t sample, const samplecnt_t sr) const { @@ -4856,8 +4860,8 @@ TempoMap::samplepos_plus_bbt (samplepos_t pos, BBT_Time op) const } /** Count the number of beats that are equivalent to distance when going forward, - starting at pos. -*/ + * starting at pos. + */ Temporal::Beats TempoMap::framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const { @@ -4867,9 +4871,9 @@ TempoMap::framewalk_to_qn (samplepos_t pos, samplecnt_t distance) const } struct bbtcmp { - bool operator() (const BBT_Time& a, const BBT_Time& b) { - return a < b; - } + bool operator() (const BBT_Time& a, const BBT_Time& b) { + return a < b; + } }; std::ostream& diff --git a/libs/backends/coreaudio/coreaudio_pcmio_aggregate.cc b/libs/backends/coreaudio/coreaudio_pcmio_aggregate.cc index 7c2d0fe196..a81bbd4add 100644 --- a/libs/backends/coreaudio/coreaudio_pcmio_aggregate.cc +++ b/libs/backends/coreaudio/coreaudio_pcmio_aggregate.cc @@ -305,7 +305,7 @@ CoreAudioPCM::create_aggregate_device ( fprintf(stderr, "AggregateDevice: kAudioObjectPropertyOwnedObjects error\n"); } - // Calculate the number of object IDs + // Calculate the number of object IDs subDevicesNum = size / sizeof(AudioObjectID); #ifndef NDEBUG printf("AggregateDevice: clock drift compensation, number of sub-devices = %u\n", (unsigned int)subDevicesNum); diff --git a/libs/evoral/src/libsmf/smf.c b/libs/evoral/src/libsmf/smf.c index f88c85ffab..1fcdb8ec38 100644 --- a/libs/evoral/src/libsmf/smf.c +++ b/libs/evoral/src/libsmf/smf.c @@ -1098,7 +1098,7 @@ smf_get_length_seconds(const smf_t *smf) smf_track_t *track; smf_event_t *event; - track = smf_get_track_by_number(smf, i); + track = smf_get_track_by_number(smf, i); assert(track); event = smf_track_get_last_event(track); diff --git a/libs/evoral/src/libsmf/smf_private.h b/libs/evoral/src/libsmf/smf_private.h index 3f7bb2940d..41ac7238fc 100644 --- a/libs/evoral/src/libsmf/smf_private.h +++ b/libs/evoral/src/libsmf/smf_private.h @@ -50,16 +50,16 @@ /** SMF chunk header, used only by smf_load.c and smf_save.c. */ struct chunk_header_struct { - char id[4]; - uint32_t length; + char id[4]; + uint32_t length; } ATTRIBUTE_PACKED; /** SMF chunk, used only by smf_load.c and smf_save.c. */ struct mthd_chunk_struct { - struct chunk_header_struct mthd_header; - uint16_t format; - uint16_t number_of_tracks; - uint16_t division; + struct chunk_header_struct mthd_header; + uint16_t format; + uint16_t number_of_tracks; + uint16_t division; } ATTRIBUTE_PACKED; #if (!defined __GNUC__) diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc index a0b09dcbc4..8b01239256 100644 --- a/libs/pbd/boost_debug.cc +++ b/libs/pbd/boost_debug.cc @@ -37,17 +37,16 @@ class Backtrace { public: - Backtrace (); - std::ostream& print (std::ostream& str) const; + Backtrace (); + std::ostream& print (std::ostream& str) const; private: - void* trace[200]; - size_t size; + void* trace[200]; + size_t size; }; std::ostream& operator<< (std::ostream& str, const Backtrace& bt) { return bt.print (str); } - Backtrace::Backtrace() { #ifdef HAVE_EXECINFO @@ -78,12 +77,11 @@ Backtrace::print (std::ostream& str) const struct BTPair { - Backtrace* ref; - Backtrace* rel; - - BTPair (Backtrace* bt) : ref (bt), rel (0) {} - ~BTPair () { } + Backtrace* ref; + Backtrace* rel; + BTPair (Backtrace* bt) : ref (bt), rel (0) {} + ~BTPair () { } }; std::ostream& operator<<(std::ostream& str, const BTPair& btp) { @@ -95,14 +93,14 @@ std::ostream& operator<<(std::ostream& str, const BTPair& btp) { } struct SPDebug { - Backtrace* constructor; - Backtrace* destructor; - - SPDebug (Backtrace* c) : constructor (c), destructor (0) {} - ~SPDebug () { - delete constructor; - delete destructor; - } + Backtrace* constructor; + Backtrace* destructor; + + SPDebug (Backtrace* c) : constructor (c), destructor (0) {} + ~SPDebug () { + delete constructor; + delete destructor; + } }; std::ostream& operator<< (std::ostream& str, const SPDebug& spd) @@ -121,27 +119,30 @@ typedef std::map IPointerMap; using namespace std; static PointerMap* _sptrs; -PointerMap& sptrs() { - if (_sptrs == 0) { - _sptrs = new PointerMap; - } - return *_sptrs; +PointerMap& sptrs() +{ + if (_sptrs == 0) { + _sptrs = new PointerMap; + } + return *_sptrs; } static IPointerMap* _interesting_pointers; -IPointerMap& interesting_pointers() { - if (_interesting_pointers == 0) { - _interesting_pointers = new IPointerMap; - } - return *_interesting_pointers; +IPointerMap& interesting_pointers() +{ + if (_interesting_pointers == 0) { + _interesting_pointers = new IPointerMap; + } + return *_interesting_pointers; } static Glib::Threads::Mutex* _the_lock; -static Glib::Threads::Mutex& the_lock() { - if (_the_lock == 0) { - _the_lock = new Glib::Threads::Mutex; - } - return *_the_lock; +static Glib::Threads::Mutex& the_lock() +{ + if (_the_lock == 0) { + _the_lock = new Glib::Threads::Mutex; + } + return *_the_lock; } @@ -169,7 +170,7 @@ void boost_debug_shared_ptr_mark_interesting (void* ptr, const char* type) { Glib::Threads::Mutex::Lock guard (the_lock()); - pair newpair (ptr, type); + pair newpair (ptr, type); interesting_pointers().insert (newpair); if (debug_out) { cerr << "Interesting object @ " << ptr << " of type " << type << endl; diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc index 3fdb8af71d..96918b9809 100644 --- a/libs/pbd/convert.cc +++ b/libs/pbd/convert.cc @@ -46,12 +46,12 @@ namespace PBD { string capitalize (const string& str) { - string ret = str; - if (!str.empty()) { - /* XXX not unicode safe */ - ret[0] = toupper (str[0]); - } - return ret; + string ret = str; + if (!str.empty()) { + /* XXX not unicode safe */ + ret[0] = toupper (str[0]); + } + return ret; } string @@ -175,8 +175,8 @@ internationalize (const char *package_name, const char **array) static int32_t int_from_hex (char hic, char loc) { - int hi; /* hi byte */ - int lo; /* low byte */ + int hi; /* hi byte */ + int lo; /* low byte */ hi = (int) hic; @@ -224,20 +224,20 @@ url_decode (string const & url) string length2string (const int32_t samples, const float sample_rate) { - int32_t secs = (int32_t) (samples / sample_rate); - int32_t hrs = secs / 3600; - secs -= (hrs * 3600); - int32_t mins = secs / 60; - secs -= (mins * 60); - - int32_t total_secs = (hrs * 3600) + (mins * 60) + secs; - int32_t samples_remaining = (int) floor (samples - (total_secs * sample_rate)); - float fractional_secs = (float) samples_remaining / sample_rate; + int32_t secs = (int32_t) (samples / sample_rate); + int32_t hrs = secs / 3600; + secs -= (hrs * 3600); + int32_t mins = secs / 60; + secs -= (mins * 60); + + int32_t total_secs = (hrs * 3600) + (mins * 60) + secs; + int32_t samples_remaining = (int) floor (samples - (total_secs * sample_rate)); + float fractional_secs = (float) samples_remaining / sample_rate; - char duration_str[32]; - sprintf (duration_str, "%02" PRIi32 ":%02" PRIi32 ":%05.2f", hrs, mins, (float) secs + fractional_secs); + char duration_str[32]; + sprintf (duration_str, "%02" PRIi32 ":%02" PRIi32 ":%05.2f", hrs, mins, (float) secs + fractional_secs); - return duration_str; + return duration_str; } #endif diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index 78bcd3d812..c6c11b6875 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -48,25 +48,25 @@ FPU* FPU::_instance (0); static void __cpuid(int regs[4], int cpuid_leaf) { - asm volatile ( + asm volatile ( #if defined(__i386__) - "pushl %%ebx;\n\t" + "pushl %%ebx;\n\t" #endif - "cpuid;\n\t" - "movl %%eax, (%1);\n\t" - "movl %%ebx, 4(%1);\n\t" - "movl %%ecx, 8(%1);\n\t" - "movl %%edx, 12(%1);\n\t" + "cpuid;\n\t" + "movl %%eax, (%1);\n\t" + "movl %%ebx, 4(%1);\n\t" + "movl %%ecx, 8(%1);\n\t" + "movl %%edx, 12(%1);\n\t" #if defined(__i386__) - "popl %%ebx;\n\t" + "popl %%ebx;\n\t" #endif - :"=a" (cpuid_leaf) /* %eax clobbered by CPUID */ - :"S" (regs), "a" (cpuid_leaf) - : + :"=a" (cpuid_leaf) /* %eax clobbered by CPUID */ + :"S" (regs), "a" (cpuid_leaf) + : #if !defined(__i386__) - "%ebx", + "%ebx", #endif - "%ecx", "%edx", "memory"); + "%ecx", "%edx", "memory"); } #endif /* !PLATFORM_WINDOWS */ @@ -158,15 +158,16 @@ FPU::FPU () return; #else - /* Get the CPU vendor just for kicks */ - - // __cpuid with an InfoType argument of 0 returns the number of - // valid Ids in CPUInfo[0] and the CPU identification string in - // the other three array elements. The CPU identification string is - // not in linear order. The code below arranges the information - // in a human readable form. The human readable order is CPUInfo[1] | - // CPUInfo[3] | CPUInfo[2]. CPUInfo[2] and CPUInfo[3] are swapped - // before using memcpy to copy these three array elements to cpu_string. + /* Get the CPU vendor just for kicks + * + * __cpuid with an InfoType argument of 0 returns the number of + * valid Ids in CPUInfo[0] and the CPU identification string in + * the other three array elements. The CPU identification string is + * not in linear order. The code below arranges the information + * in a human readable form. The human readable order is CPUInfo[1] | + * CPUInfo[3] | CPUInfo[2]. CPUInfo[2] and CPUInfo[3] are swapped + * before using memcpy to copy these three array elements to cpu_string. + */ int cpu_info[4]; char cpu_string[48]; @@ -175,9 +176,9 @@ FPU::FPU () __cpuid (cpu_info, 0); int num_ids = cpu_info[0]; - std::swap(cpu_info[2], cpu_info[3]); + std::swap(cpu_info[2], cpu_info[3]); memcpy(cpu_string, &cpu_info[1], 3 * sizeof(cpu_info[1])); - cpu_vendor.assign(cpu_string, 3 * sizeof(cpu_info[1])); + cpu_vendor.assign(cpu_string, 3 * sizeof(cpu_info[1])); info << string_compose (_("CPU vendor: %1"), cpu_vendor) << endmsg; diff --git a/libs/pbd/pbd.cc b/libs/pbd/pbd.cc index a7a818ee5f..a43204404b 100644 --- a/libs/pbd/pbd.cc +++ b/libs/pbd/pbd.cc @@ -97,7 +97,7 @@ PBD::init () // will be created or opened in BINARY mode! _fmode = O_BINARY; - WSADATA wsaData; + WSADATA wsaData; /* Initialize windows socket DLL for PBD::CrossThreadChannel */ diff --git a/libs/pbd/pbd/compose.h b/libs/pbd/pbd/compose.h index 231afa583e..c7a225ca32 100644 --- a/libs/pbd/pbd/compose.h +++ b/libs/pbd/pbd/compose.h @@ -36,400 +36,397 @@ #include #include #include -#include // for multimap +#include // for multimap #include "pbd/libpbd_visibility.h" namespace StringPrivate { - // the actual composition class - using string::compose is cleaner, so we - // hide it here - class LIBPBD_API Composition - { - public: - // initialize and prepare format string on the form "text %1 text %2 etc." - explicit Composition(std::string fmt); - - // supply an replacement argument starting from %1 - template - Composition &arg(const T &obj); - - // specialization to catch strings (C++ and C) - Composition &arg(const std::string &str); - Composition &arg(char const * const cstr); - - // compose and return string - std::string str() const; - - private: - std::ostringstream os; - int arg_no; - - // we store the output as a list - when the output string is requested, the - // list is concatenated to a string; this way we can keep iterators into - // the list instead of into a string where they're possibly invalidated on - // inserting a specification string - typedef std::list output_list; - output_list output; - - // the initial parse of the format string fills in the specification map - // with positions for each of the various %?s - typedef std::multimap specification_map; - specification_map specs; - }; - - // helper for converting spec string numbers - inline int char_to_int(char c) - { - switch (c) { - case '0': return 0; - case '1': return 1; - case '2': return 2; - case '3': return 3; - case '4': return 4; - case '5': return 5; - case '6': return 6; - case '7': return 7; - case '8': return 8; - case '9': return 9; - default: return -1000; - } - } - - inline bool is_number(int n) - { - switch (n) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - return true; - - default: - return false; - } - } - - - // implementation of class Composition - template - inline Composition &Composition::arg(const T &obj) - { - os << obj; - - std::string rep = os.str(); - - if (!rep.empty()) { // manipulators don't produce output - for (specification_map::const_iterator i = specs.lower_bound(arg_no), - end = specs.upper_bound(arg_no); i != end; ++i) { - output_list::iterator pos = i->second; - ++pos; - - output.insert(pos, rep); - } - - os.str(std::string()); - //os.clear(); - ++arg_no; - } - - return *this; - } - - inline Composition &Composition::arg(const std::string &str) - { - /* specialization to ensure that empty strings show up - * in the output - */ - for (specification_map::const_iterator i = specs.lower_bound(arg_no), - end = specs.upper_bound(arg_no); i != end; ++i) { - output_list::iterator pos = i->second; - ++pos; - - output.insert(pos, str); - } - - ++arg_no; - - return *this; - } - - inline Composition &Composition::arg(char const * const cstr) - { - /* specialization to ensure that empty C strings show up - * in the output - */ - for (specification_map::const_iterator i = specs.lower_bound(arg_no), - end = specs.upper_bound(arg_no); i != end; ++i) { - output_list::iterator pos = i->second; - ++pos; - - output.insert(pos, std::string (cstr)); - } - - ++arg_no; - - return *this; - } - - inline Composition::Composition(std::string fmt) - : arg_no(1) - { - std::string::size_type b = 0, i = 0; - - // fill in output with the strings between the %1 %2 %3 etc. and - // fill in specs with the positions - while (i < fmt.length()) { - if (fmt[i] == '%' && i + 1 < fmt.length()) { - if (fmt[i + 1] == '%') { // catch %% - fmt.replace(i, 2, "%"); - ++i; +// the actual composition class - using string::compose is cleaner, so we +// hide it here +class LIBPBD_API Composition +{ +public: + // initialize and prepare format string on the form "text %1 text %2 etc." + explicit Composition(std::string fmt); + + // supply an replacement argument starting from %1 + template + Composition &arg(const T &obj); + + // specialization to catch strings (C++ and C) + Composition &arg(const std::string &str); + Composition &arg(char const * const cstr); + + // compose and return string + std::string str() const; + +private: + std::ostringstream os; + int arg_no; + + // we store the output as a list - when the output string is requested, the + // list is concatenated to a string; this way we can keep iterators into + // the list instead of into a string where they're possibly invalidated on + // inserting a specification string + typedef std::list output_list; + output_list output; + + // the initial parse of the format string fills in the specification map + // with positions for each of the various %?s + typedef std::multimap specification_map; + specification_map specs; +}; + +// helper for converting spec string numbers +inline int char_to_int(char c) +{ + switch (c) { + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + default: return -1000; + } +} + +inline bool is_number(int n) +{ + switch (n) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return true; + + default: + return false; } - else if (is_number(fmt[i + 1])) { // aha! a spec! - // save string - output.push_back(fmt.substr(b, i - b)); +} + +// implementation of class Composition +template + inline Composition &Composition::arg(const T &obj) + { + os << obj; + + std::string rep = os.str(); + + if (!rep.empty()) { // manipulators don't produce output + for (specification_map::const_iterator i = specs.lower_bound(arg_no), + end = specs.upper_bound(arg_no); i != end; ++i) { + output_list::iterator pos = i->second; + ++pos; + + output.insert(pos, rep); + } + + os.str(std::string()); + //os.clear(); + ++arg_no; + } + + return *this; + } + +inline Composition &Composition::arg(const std::string &str) +{ + /* specialization to ensure that empty strings show up + * in the output + */ + for (specification_map::const_iterator i = specs.lower_bound(arg_no), + end = specs.upper_bound(arg_no); i != end; ++i) { + output_list::iterator pos = i->second; + ++pos; + + output.insert(pos, str); + } + + ++arg_no; + + return *this; +} - int n = 1; // number of digits - int spec_no = 0; +inline Composition &Composition::arg(char const * const cstr) +{ + /* specialization to ensure that empty C strings show up + * in the output + */ + for (specification_map::const_iterator i = specs.lower_bound(arg_no), + end = specs.upper_bound(arg_no); i != end; ++i) { + output_list::iterator pos = i->second; + ++pos; + + output.insert(pos, std::string (cstr)); + } - do { - spec_no += char_to_int(fmt[i + n]); - spec_no *= 10; - ++n; - } while (i + n < fmt.length() && is_number(fmt[i + n])); + ++arg_no; - spec_no /= 10; - output_list::iterator pos = output.end(); - --pos; // safe since we have just inserted a string> + return *this; +} - specs.insert(specification_map::value_type(spec_no, pos)); +inline Composition::Composition(std::string fmt) + : arg_no(1) +{ + std::string::size_type b = 0, i = 0; + + // fill in output with the strings between the %1 %2 %3 etc. and + // fill in specs with the positions + while (i < fmt.length()) { + if (fmt[i] == '%' && i + 1 < fmt.length()) { + if (fmt[i + 1] == '%') { // catch %% + fmt.replace(i, 2, "%"); + ++i; + } + else if (is_number(fmt[i + 1])) { // aha! a spec! + // save string + output.push_back(fmt.substr(b, i - b)); + + int n = 1; // number of digits + int spec_no = 0; + + do { + spec_no += char_to_int(fmt[i + n]); + spec_no *= 10; + ++n; + } while (i + n < fmt.length() && is_number(fmt[i + n])); + + spec_no /= 10; + output_list::iterator pos = output.end(); + --pos; // safe since we have just inserted a string> + + specs.insert(specification_map::value_type(spec_no, pos)); + + // jump over spec string + i += n; + b = i; + } + else + ++i; + } + else + ++i; + } - // jump over spec string - i += n; - b = i; + if (i - b > 0) { // add the rest of the string + output.push_back(fmt.substr(b, i - b)); } - else - ++i; - } - else - ++i; - } - - if (i - b > 0) // add the rest of the string - output.push_back(fmt.substr(b, i - b)); - } - - inline std::string Composition::str() const - { - // assemble string - std::string str; - - for (output_list::const_iterator i = output.begin(), end = output.end(); - i != end; ++i) - str += *i; - - return str; - } +} + +inline std::string Composition::str() const +{ + // assemble string + std::string str; + + for (output_list::const_iterator i = output.begin(), end = output.end(); + i != end; ++i) + str += *i; + + return str; +} } // now for the real thing(s) -//namespace PBD -//{ - // a series of functions which accept a format string on the form "text %1 - // more %2 less %3" and a number of templated parameters and spits out the - // composited string - template - inline std::string string_compose(const std::string &fmt, const T1 &o1) - { - StringPrivate::Composition c(fmt); - c.arg(o1); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9, - const T10 &o10) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) - .arg(o10); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9, - const T10 &o10, const T11 &o11) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) - .arg(o10).arg(o11); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9, - const T10 &o10, const T11 &o11, const T12 &o12) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) - .arg(o10).arg(o11).arg(o12); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9, - const T10 &o10, const T11 &o11, const T12 &o12, - const T13 &o13) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) - .arg(o10).arg(o11).arg(o12).arg(o13); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9, - const T10 &o10, const T11 &o11, const T12 &o12, - const T13 &o13, const T14 &o14) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) - .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14); - return c.str(); - } - - template - inline std::string string_compose(const std::string &fmt, - const T1 &o1, const T2 &o2, const T3 &o3, - const T4 &o4, const T5 &o5, const T6 &o6, - const T7 &o7, const T8 &o8, const T9 &o9, - const T10 &o10, const T11 &o11, const T12 &o12, - const T13 &o13, const T14 &o14, const T15 &o15) - { - StringPrivate::Composition c(fmt); - c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) - .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14).arg(o15); - return c.str(); - } -//} +// a series of functions which accept a format string on the form "text %1 +// more %2 less %3" and a number of templated parameters and spits out the +// composited string +template +inline std::string string_compose(const std::string &fmt, const T1 &o1) +{ + StringPrivate::Composition c(fmt); + c.arg(o1); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9, + const T10 &o10) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) + .arg(o10); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9, + const T10 &o10, const T11 &o11) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) + .arg(o10).arg(o11); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9, + const T10 &o10, const T11 &o11, const T12 &o12) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) + .arg(o10).arg(o11).arg(o12); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9, + const T10 &o10, const T11 &o11, const T12 &o12, + const T13 &o13) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) + .arg(o10).arg(o11).arg(o12).arg(o13); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9, + const T10 &o10, const T11 &o11, const T12 &o12, + const T13 &o13, const T14 &o14) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) + .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14); + return c.str(); +} + +template +inline std::string string_compose(const std::string &fmt, + const T1 &o1, const T2 &o2, const T3 &o3, + const T4 &o4, const T5 &o5, const T6 &o6, + const T7 &o7, const T8 &o8, const T9 &o9, + const T10 &o10, const T11 &o11, const T12 &o12, + const T13 &o13, const T14 &o14, const T15 &o15) +{ + StringPrivate::Composition c(fmt); + c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9) + .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14).arg(o15); + return c.str(); +} #endif // STRING_COMPOSE_H diff --git a/libs/pbd/pbd/msvc_pbd.h b/libs/pbd/pbd/msvc_pbd.h index 7c981582c5..a471dd11ba 100644 --- a/libs/pbd/pbd/msvc_pbd.h +++ b/libs/pbd/pbd/msvc_pbd.h @@ -80,11 +80,11 @@ #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ #ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +} /* extern "C" */ +#endif /* __cplusplus */ #ifdef PLATFORM_WINDOWS @@ -121,22 +121,22 @@ extern "C" { #endif #ifndef OPEN_MAX -#define OPEN_MAX 32 +#define OPEN_MAX (32) #endif #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ -PBDEXTN_API int PBDEXTN_APICALLTYPE cyginit (unsigned int result); -LIBPBD_API int PBD_APICALLTYPE dlclose (void *handle) __THROW; -LIBPBD_API void* PBD_APICALLTYPE dlopen (const char *file_name, int mode) __THROW; -LIBPBD_API void* PBD_APICALLTYPE dlsym (void *handle, const char *symbol_name) __THROW; -LIBPBD_API char* PBD_APICALLTYPE dlerror () __THROW; +PBDEXTN_API int PBDEXTN_APICALLTYPE cyginit (unsigned int result); +LIBPBD_API int PBD_APICALLTYPE dlclose (void *handle) __THROW; +LIBPBD_API void* PBD_APICALLTYPE dlopen (const char *file_name, int mode) __THROW; +LIBPBD_API void* PBD_APICALLTYPE dlsym (void *handle, const char *symbol_name) __THROW; +LIBPBD_API char* PBD_APICALLTYPE dlerror () __THROW; #ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +} /* extern "C" */ +#endif /* __cplusplus */ #ifndef __CYGWIN__ /* For whatever reason, Ardour's 'libevoral' refuses to build as a DLL if we include both 'rpc.h' */ @@ -157,17 +157,17 @@ typedef int (FAR PBDEXTN_APICALLTYPE *CYGINIT_API)(unsigned int); #define _SSIZE_T_ typedef long _ssize_t; -#ifndef _NO_OLDNAMES +#ifndef _NO_OLDNAMES typedef _ssize_t ssize_t; #endif #endif /* ! _SSIZE_T_ */ struct dirent { - long d_ino; // Always zero - unsigned short d_reclen; // Always zero - unsigned short d_namlen; // Length of name in d_name - char d_name[FILENAME_MAX]; // File name + long d_ino; // Always zero + unsigned short d_reclen; // Always zero + unsigned shor d_namlen; // Length of name in d_name + char d_name[FILENAME_MAX]; // File name }; // This is an internal data structure. Do not use it @@ -175,65 +175,65 @@ struct dirent typedef struct { // Disk transfer area for this dir - struct _finddata_t dd_dta; + struct _finddata_t dd_dta; // 'dirent' struct to return from dir (NOTE: this // is not thread safe). - struct dirent dd_dir; + struct dirent dd_dir; // '_findnext()' handle - long dd_handle; + long dd_handle; // Current status of search: // 0 = not started yet (next entry to read is first entry) // -1 = off the end // Otherwise - positive (0 based) index of next entry - int dd_stat; + int dd_stat; // Full path for dir with search pattern (struct will be extended) - char dd_name[1]; + char dd_name[1]; } DIR; typedef unsigned int nfds_t; #ifdef __cplusplus extern "C" { -#endif /* __cplusplus */ +#endif /* __cplusplus */ -LIBPBD_API int __cdecl gettimeofday(struct timeval *__restrict tv, __timezone_ptr_t tz); -LIBPBD_API ssize_t PBD_APICALLTYPE pread(int handle, void *buf, size_t nbytes, off_t offset); -LIBPBD_API ssize_t PBD_APICALLTYPE pwrite(int handle, const void *buf, size_t nbytes, off_t offset); +LIBPBD_API int __cdecl gettimeofday(struct timeval *__restrict tv, __timezone_ptr_t tz); +LIBPBD_API ssize_t PBD_APICALLTYPE pread(int handle, void *buf, size_t nbytes, off_t offset); +LIBPBD_API ssize_t PBD_APICALLTYPE pwrite(int handle, const void *buf, size_t nbytes, off_t offset); #if defined(_MSC_VER) && (_MSC_VER < 1800) -LIBPBD_API double PBD_APICALLTYPE expm1(double x); -LIBPBD_API double PBD_APICALLTYPE log1p(double x); -LIBPBD_API double PBD_APICALLTYPE round(double x); -LIBPBD_API float PBD_APICALLTYPE roundf(float x); +LIBPBD_API double PBD_APICALLTYPE expm1(double x); +LIBPBD_API double PBD_APICALLTYPE log1p(double x); +LIBPBD_API double PBD_APICALLTYPE round(double x); +LIBPBD_API float PBD_APICALLTYPE roundf(float x); #endif #if defined(_MSC_VER) && (_MSC_VER < 1900) -LIBPBD_API double PBD_APICALLTYPE log2 (double x); -LIBPBD_API double PBD_APICALLTYPE trunc(double x); +LIBPBD_API double PBD_APICALLTYPE log2 (double x); +LIBPBD_API double PBD_APICALLTYPE trunc(double x); #endif namespace PBD { -LIBPBD_API bool PBD_APICALLTYPE TestForMinimumSpecOS(char *revision="currently ignored"); -LIBPBD_API char* PBD_APICALLTYPE realpath (const char *original_path, char resolved_path[_MAX_PATH+1]); -LIBPBD_API int PBD_APICALLTYPE mkstemp (char *template_name); -LIBPBD_API int PBD_APICALLTYPE ntfs_link (const char *existing_filepath, const char *link_filepath); -LIBPBD_API int PBD_APICALLTYPE ntfs_unlink (const char *link_filepath); +LIBPBD_API bool PBD_APICALLTYPE TestForMinimumSpecOS(char *revision="currently ignored"); +LIBPBD_API char* PBD_APICALLTYPE realpath (const char *original_path, char resolved_path[_MAX_PATH+1]); +LIBPBD_API int PBD_APICALLTYPE mkstemp (char *template_name); +LIBPBD_API int PBD_APICALLTYPE ntfs_link (const char *existing_filepath, const char *link_filepath); +LIBPBD_API int PBD_APICALLTYPE ntfs_unlink (const char *link_filepath); // These are used to replicate 'dirent.h' functionality -LIBPBD_API DIR* PBD_APICALLTYPE opendir (const char *szPath); -LIBPBD_API struct dirent* PBD_APICALLTYPE readdir (DIR *pDir); -LIBPBD_API int PBD_APICALLTYPE closedir (DIR *pDir); +LIBPBD_API DIR* PBD_APICALLTYPE opendir (const char *szPath); +LIBPBD_API struct dirent* PBD_APICALLTYPE readdir (DIR *pDir); +LIBPBD_API int PBD_APICALLTYPE closedir (DIR *pDir); } // namespace PBD #ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ +} /* extern "C" */ +#endif /* __cplusplus */ #endif // !__CYGWIN__ #endif // PLATFORM_WINDOWS diff --git a/libs/pbd/pbd/ringbuffer.h b/libs/pbd/pbd/ringbuffer.h index 9b5b09651e..bed9e829fb 100644 --- a/libs/pbd/pbd/ringbuffer.h +++ b/libs/pbd/pbd/ringbuffer.h @@ -30,16 +30,18 @@ namespace PBD { template class /*LIBPBD_API*/ RingBuffer { - public: +public: RingBuffer (guint sz) { -// size = ffs(sz); /* find first [bit] set is a single inlined assembly instruction. But it looks like the API rounds up so... */ - guint power_of_two; - for (power_of_two = 1; 1U< /*LIBPBD_API*/ guint RingBuffer::read (T *dest, guint cnt) { - guint free_cnt; - guint cnt2; - guint to_read; - guint n1, n2; - guint priv_read_idx; + guint free_cnt; + guint cnt2; + guint to_read; + guint n1, n2; + guint priv_read_idx; - priv_read_idx=g_atomic_int_get(&read_idx); + priv_read_idx=g_atomic_int_get(&read_idx); - if ((free_cnt = read_space ()) == 0) { - return 0; - } + if ((free_cnt = read_space ()) == 0) { + return 0; + } - to_read = cnt > free_cnt ? free_cnt : cnt; + to_read = cnt > free_cnt ? free_cnt : cnt; - cnt2 = priv_read_idx + to_read; + cnt2 = priv_read_idx + to_read; - if (cnt2 > size) { - n1 = size - priv_read_idx; - n2 = cnt2 & size_mask; - } else { - n1 = to_read; - n2 = 0; - } + if (cnt2 > size) { + n1 = size - priv_read_idx; + n2 = cnt2 & size_mask; + } else { + n1 = to_read; + n2 = 0; + } - memcpy (dest, &buf[priv_read_idx], n1 * sizeof (T)); - priv_read_idx = (priv_read_idx + n1) & size_mask; + memcpy (dest, &buf[priv_read_idx], n1 * sizeof (T)); + priv_read_idx = (priv_read_idx + n1) & size_mask; - if (n2) { - memcpy (dest+n1, buf, n2 * sizeof (T)); - priv_read_idx = n2; - } + if (n2) { + memcpy (dest+n1, buf, n2 * sizeof (T)); + priv_read_idx = n2; + } - g_atomic_int_set(&read_idx, priv_read_idx); - return to_read; + g_atomic_int_set(&read_idx, priv_read_idx); + return to_read; } template /*LIBPBD_API*/ guint RingBuffer::write (T const *src, guint cnt) { - guint free_cnt; - guint cnt2; - guint to_write; - guint n1, n2; - guint priv_write_idx; + guint free_cnt; + guint cnt2; + guint to_write; + guint n1, n2; + guint priv_write_idx; - priv_write_idx=g_atomic_int_get(&write_idx); + priv_write_idx=g_atomic_int_get(&write_idx); - if ((free_cnt = write_space ()) == 0) { - return 0; - } + if ((free_cnt = write_space ()) == 0) { + return 0; + } - to_write = cnt > free_cnt ? free_cnt : cnt; + to_write = cnt > free_cnt ? free_cnt : cnt; - cnt2 = priv_write_idx + to_write; + cnt2 = priv_write_idx + to_write; - if (cnt2 > size) { - n1 = size - priv_write_idx; - n2 = cnt2 & size_mask; - } else { - n1 = to_write; - n2 = 0; - } + if (cnt2 > size) { + n1 = size - priv_write_idx; + n2 = cnt2 & size_mask; + } else { + n1 = to_write; + n2 = 0; + } - memcpy (&buf[priv_write_idx], src, n1 * sizeof (T)); - priv_write_idx = (priv_write_idx + n1) & size_mask; + memcpy (&buf[priv_write_idx], src, n1 * sizeof (T)); + priv_write_idx = (priv_write_idx + n1) & size_mask; - if (n2) { - memcpy (buf, src+n1, n2 * sizeof (T)); - priv_write_idx = n2; - } + if (n2) { + memcpy (buf, src+n1, n2 * sizeof (T)); + priv_write_idx = n2; + } - g_atomic_int_set(&write_idx, priv_write_idx); - return to_write; + g_atomic_int_set(&write_idx, priv_write_idx); + return to_write; } template /*LIBPBD_API*/ void diff --git a/libs/pbd/pbd/timersub.h b/libs/pbd/pbd/timersub.h index 6cb152414c..785cbdde9d 100644 --- a/libs/pbd/pbd/timersub.h +++ b/libs/pbd/pbd/timersub.h @@ -1,5 +1,5 @@ /* Copyright (C) 1991-1994,1996-2003,2005,2006,2009 - Free Software Foundation, Inc. + Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,14 +19,13 @@ #include #ifndef timersub -# define timersub(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ - if ((result)->tv_usec < 0) { \ - --(result)->tv_sec; \ - (result)->tv_usec += 1000000; \ - } \ +# define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ } while (0) #endif - diff --git a/libs/pbd/pbd/tokenizer.h b/libs/pbd/pbd/tokenizer.h index ef9f3c951e..78e6be0490 100644 --- a/libs/pbd/pbd/tokenizer.h +++ b/libs/pbd/pbd/tokenizer.h @@ -43,49 +43,47 @@ tokenize(const StringType& str, Iter it, bool strip_whitespace=false) { - typename StringType::size_type start_pos = 0; - typename StringType::size_type end_pos = 0; - unsigned int token_count = 0; - - do { - start_pos = str.find_first_not_of(delims, start_pos); - end_pos = str.find_first_of(delims, start_pos); - if (start_pos != end_pos) { - if (end_pos == str.npos) { - end_pos = str.length(); - } - if (strip_whitespace) { + typename StringType::size_type start_pos = 0; + typename StringType::size_type end_pos = 0; + unsigned int token_count = 0; + + do { + start_pos = str.find_first_not_of(delims, start_pos); + end_pos = str.find_first_of(delims, start_pos); + if (start_pos != end_pos) { + if (end_pos == str.npos) { + end_pos = str.length(); + } + if (strip_whitespace) { StringType stripped = str.substr(start_pos, end_pos - start_pos); strip_whitespace_edges (stripped); if (stripped.length()) { *it++ = stripped; } } else { - *it++ = str.substr(start_pos, end_pos - start_pos); + *it++ = str.substr(start_pos, end_pos - start_pos); } - ++token_count; - start_pos = str.find_first_not_of(delims, end_pos + 1); - } - } while (start_pos != str.npos); + ++token_count; + start_pos = str.find_first_not_of(delims, end_pos + 1); + } + } while (start_pos != str.npos); - if (start_pos != str.npos) { - if (strip_whitespace) { + if (start_pos != str.npos) { + if (strip_whitespace) { StringType stripped = str.substr(start_pos, str.length() - start_pos); strip_whitespace_edges (stripped); if (stripped.length()) { *it++ = stripped; } } else { - *it++ = str.substr(start_pos, str.length() - start_pos); + *it++ = str.substr(start_pos, str.length() - start_pos); } - ++token_count; - } + ++token_count; + } - return token_count; + return token_count; } } // namespace PBD #endif // PBD_TOKENIZER - - diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index c18d36f065..6548852917 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -258,7 +258,7 @@ XMLNode::clear_lists () _selected_children.clear (); - for (curchild = _children.begin(); curchild != _children.end(); ++curchild) { + for (curchild = _children.begin(); curchild != _children.end(); ++curchild) { delete *curchild; } @@ -665,8 +665,7 @@ XMLNode::remove_nodes_and_delete(const string& propname, const string& val) } void -XMLNode::remove_node_and_delete(const string& n, const string& propname, - const string& val) +XMLNode::remove_node_and_delete(const string& n, const string& propname, const string& val) { for (XMLNodeIterator i = _children.begin(); i != _children.end(); ++i) { if ((*i)->name() == n) { diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc index 8406855140..e428da44f0 100644 --- a/libs/surfaces/faderport/gui.cc +++ b/libs/surfaces/faderport/gui.cc @@ -531,8 +531,10 @@ FPGUI::build_proj_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs) actions.push_back (make_pair (string("Toggle Meterbridge"), string(X_("Common/toggle-meterbridge")))); actions.push_back (make_pair (string (_("Zoom to Session")), string (X_("Editor/zoom-to-session")))); -// actions.push_back (make_pair (string (_("Zoom In")), string (X_("Editor/temporal-zoom-in")))); -// actions.push_back (make_pair (string (_("Zoom Out")), string (X_("Editor/temporal-zoom-out")))); +#if 0 + actions.push_back (make_pair (string (_("Zoom In")), string (X_("Editor/temporal-zoom-in")))); + actions.push_back (make_pair (string (_("Zoom Out")), string (X_("Editor/temporal-zoom-out")))); +#endif build_action_combo (cb, actions, FaderPort::Proj, bs); } diff --git a/libs/surfaces/us2400/device_info.cc b/libs/surfaces/us2400/device_info.cc index d1a042fcbb..d712ea7f4d 100644 --- a/libs/surfaces/us2400/device_info.cc +++ b/libs/surfaces/us2400/device_info.cc @@ -109,11 +109,12 @@ DeviceInfo::logic_control_buttons () void DeviceInfo::shared_buttons () { -// US-2499 button notes: -// CHAN button sends nothing. it inititates a dumb 0..127 knob mode for the 24 knobs -// PAN sends the regular pan/surround message. this tells our strips to send the pan knob position -// AUX1-6 all send the same 0x29 + 0x21 message, I believe the surface uses this to captures knob info, somehow - + /* US-2499 button notes: + * CHAN button sends nothing. it inititates a dumb 0..127 knob mode for the 24 knobs + * PAN sends the regular pan/surround message. this tells our strips to send the pan knob position + * AUX1-6 all send the same 0x29 + 0x21 message, I believe the surface uses this to captures knob info, somehow + */ + _global_buttons[Button::Pan] = GlobalButtonInfo ("Pan/Surround", "assignment", 0x2a); // US-2400: this is sent (on&off in one msg) from the Pan button _global_buttons[Button::Left] = GlobalButtonInfo ("Bank Left", "bank", 0x2e); @@ -300,7 +301,7 @@ static Searchpath devinfo_search_path () { bool devinfo_path_defined = false; - std::string spath_env (Glib::getenv (devinfo_env_variable_name, devinfo_path_defined)); + std::string spath_env (Glib::getenv (devinfo_env_variable_name, devinfo_path_defined)); if (devinfo_path_defined) { return spath_env; diff --git a/libs/surfaces/us2400/strip.cc b/libs/surfaces/us2400/strip.cc index bc270df024..8298ff3a93 100644 --- a/libs/surfaces/us2400/strip.cc +++ b/libs/surfaces/us2400/strip.cc @@ -263,14 +263,18 @@ Strip::reset_stripable () void Strip::notify_all() { -// if (!_stripable) { -// zero (); -// return; -// } +#if 0 + if (!_stripable) { + zero (); + return; + } +#endif // The active V-pot control may not be active for this strip // But if we zero it in the controls function it may erase // the one we do want -// _surface->write (_vpot->zero()); +#if 0 + _surface->write (_vpot->zero()); +#endif notify_solo_changed (); notify_mute_changed (); @@ -281,15 +285,19 @@ Strip::notify_all() notify_vpot_change (); notify_panner_width_changed (); notify_record_enable_changed (); -// notify_processor_changed (); +#if 0 + notify_processor_changed (); +#endif } void Strip::notify_solo_changed () { -// if (_stripable && _solo) { -// _surface->write (_solo->set_state (_stripable->solo_control()->soloed() ? on : off)); -// } +#if 0 + if (_stripable && _solo) { + _surface->write (_solo->set_state (_stripable->solo_control()->soloed() ? on : off)); + } +#endif _solo->mark_dirty (); _trickle_counter = 0; @@ -299,14 +307,16 @@ void Strip::notify_mute_changed () { DEBUG_TRACE (DEBUG::US2400, string_compose ("Strip %1 mute changed\n", _index)); -// if (_stripable && _mute) { -// DEBUG_TRACE (DEBUG::US2400, string_compose ("\tstripable muted ? %1\n", _stripable->mute_control()->muted())); -// DEBUG_TRACE (DEBUG::US2400, string_compose ("mute message: %1\n", _mute->set_state (_stripable->mute_control()->muted() ? on : off))); -// -// _surface->write (_mute->set_state (_stripable->mute_control()->muted() ? on : off)); -// } else { -// _surface->write (_mute->zero()); -// } +#if 0 + if (_stripable && _mute) { + DEBUG_TRACE (DEBUG::US2400, string_compose ("\tstripable muted ? %1\n", _stripable->mute_control()->muted())); + DEBUG_TRACE (DEBUG::US2400, string_compose ("mute message: %1\n", _mute->set_state (_stripable->mute_control()->muted() ? on : off))); + + _surface->write (_mute->set_state (_stripable->mute_control()->muted() ? on : off)); + } else { + _surface->write (_mute->zero()); + } +#endif _mute->mark_dirty (); _trickle_counter = 0; @@ -346,10 +356,11 @@ Strip::update_selection_state () { _select->mark_dirty (); _trickle_counter = 0; - -// if(_stripable) { -// _surface->write (_select->set_state (_stripable->is_selected())); -// } +#if 0 + if(_stripable) { + _surface->write (_select->set_state (_stripable->is_selected())); + } +#endif } void diff --git a/libs/surfaces/us2400/strip.h b/libs/surfaces/us2400/strip.h index d963c12836..bc598e802b 100644 --- a/libs/surfaces/us2400/strip.h +++ b/libs/surfaces/us2400/strip.h @@ -113,7 +113,7 @@ private: PBD::ScopedConnectionList send_connections; int eq_band; - int _trickle_counter; + int _trickle_counter; ARDOUR::AutomationType _pan_mode; diff --git a/libs/widgets/ardour_dropdown.cc b/libs/widgets/ardour_dropdown.cc index e54213df0e..fe69d279a8 100644 --- a/libs/widgets/ardour_dropdown.cc +++ b/libs/widgets/ardour_dropdown.cc @@ -49,7 +49,6 @@ using namespace std; ArdourDropdown::ArdourDropdown (Element e) : _scrolling_disabled(false) { -// signal_button_press_event().connect (sigc::mem_fun(*this, &ArdourDropdown::on_mouse_pressed)); _menu.signal_size_request().connect (sigc::mem_fun(*this, &ArdourDropdown::menu_size_request)); _menu.set_reserve_toggle_size(false); diff --git a/libs/widgets/widgets/ardour_knob.h b/libs/widgets/widgets/ardour_knob.h index b424e13a8a..67a2741e9f 100644 --- a/libs/widgets/widgets/ardour_knob.h +++ b/libs/widgets/widgets/ardour_knob.h @@ -82,7 +82,7 @@ public: void set_tooltip_prefix (std::string pfx) { _tooltip_prefix = pfx; controllable_changed (true); } boost::shared_ptr get_controllable() { return binding_proxy.get_controllable(); } - void set_controllable (boost::shared_ptr c); + void set_controllable (boost::shared_ptr c); bool on_button_press_event (GdkEventButton*); bool on_button_release_event (GdkEventButton*); diff --git a/libs/widgets/widgets/ardour_spacer.h b/libs/widgets/widgets/ardour_spacer.h index d7c915a007..538bec2320 100644 --- a/libs/widgets/widgets/ardour_spacer.h +++ b/libs/widgets/widgets/ardour_spacer.h @@ -86,7 +86,7 @@ protected: ctx->set_source (_gradient); ctx->rectangle (0, 0, 4, height); ctx->fill (); - } + } } float alpha; diff --git a/libs/widgets/widgets/binding_proxy.h b/libs/widgets/widgets/binding_proxy.h index 4d5051382d..2a8fad9643 100644 --- a/libs/widgets/widgets/binding_proxy.h +++ b/libs/widgets/widgets/binding_proxy.h @@ -49,7 +49,7 @@ public: bool button_press_handler (GdkEventButton *); boost::shared_ptr get_controllable() const { return controllable; } - void set_controllable (boost::shared_ptr); + void set_controllable (boost::shared_ptr); protected: ArdourWidgets::PopUp* prompter; -- cgit v1.2.3